mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #28357 -- Fixed ModelAdmin.prepopulated_fields on newly added stacked inline.
Thanks Jakob Köhler for the initial patch.
This commit is contained in:
committed by
Mariusz Felisiak
parent
3f0025c18a
commit
bb223c6f78
@@ -767,8 +767,22 @@ class RelatedPrepopulatedInline3(admin.TabularInline):
|
||||
autocomplete_fields = ['fk', 'm2m']
|
||||
|
||||
|
||||
class RelatedPrepopulatedStackedInlineNoFieldsets(admin.StackedInline):
|
||||
model = RelatedPrepopulated
|
||||
extra = 1
|
||||
prepopulated_fields = {
|
||||
'slug1': ['name', 'pubdate'],
|
||||
'slug2': ['status'],
|
||||
}
|
||||
|
||||
|
||||
class MainPrepopulatedAdmin(admin.ModelAdmin):
|
||||
inlines = [RelatedPrepopulatedInline1, RelatedPrepopulatedInline2, RelatedPrepopulatedInline3]
|
||||
inlines = [
|
||||
RelatedPrepopulatedInline1,
|
||||
RelatedPrepopulatedInline2,
|
||||
RelatedPrepopulatedInline3,
|
||||
RelatedPrepopulatedStackedInlineNoFieldsets,
|
||||
]
|
||||
fieldsets = (
|
||||
(None, {
|
||||
'fields': (('pubdate', 'status'), ('name', 'slug1', 'slug2', 'slug3'))
|
||||
|
||||
Reference in New Issue
Block a user