mirror of
https://github.com/django/django.git
synced 2025-09-26 12:09:19 +00:00
Refs #26961 -- Fixed invalid ModelAdmins in tests.
This commit is contained in:
parent
8b734d2f99
commit
cd86f03591
2 changed files with 11 additions and 8 deletions
|
@ -310,7 +310,8 @@ class ParentAdmin(admin.ModelAdmin):
|
|||
model = Parent
|
||||
inlines = [ChildInline]
|
||||
save_as = True
|
||||
|
||||
list_display = ('id', 'name',)
|
||||
list_display_links = ('id',)
|
||||
list_editable = ('name',)
|
||||
|
||||
def save_related(self, request, form, formsets, change):
|
||||
|
@ -576,14 +577,14 @@ class StoryAdmin(admin.ModelAdmin):
|
|||
list_display_links = ('title',) # 'id' not in list_display_links
|
||||
list_editable = ('content', )
|
||||
form = StoryForm
|
||||
ordering = ["-pk"]
|
||||
ordering = ['-id']
|
||||
|
||||
|
||||
class OtherStoryAdmin(admin.ModelAdmin):
|
||||
list_display = ('id', 'title', 'content')
|
||||
list_display_links = ('title', 'id') # 'id' in list_display_links
|
||||
list_editable = ('content', )
|
||||
ordering = ["-pk"]
|
||||
ordering = ['-id']
|
||||
|
||||
|
||||
class ComplexSortedPersonAdmin(admin.ModelAdmin):
|
||||
|
@ -710,7 +711,8 @@ class MainPrepopulatedAdmin(admin.ModelAdmin):
|
|||
|
||||
|
||||
class UnorderedObjectAdmin(admin.ModelAdmin):
|
||||
list_display = ['name']
|
||||
list_display = ['id', 'name']
|
||||
list_display_links = ['id']
|
||||
list_editable = ['name']
|
||||
list_per_page = 2
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue