mirror of
				https://github.com/django/django.git
				synced 2025-10-30 17:16:10 +00:00 
			
		
		
		
	Refs #26961 -- Fixed invalid ModelAdmins in tests.
This commit is contained in:
		| @@ -310,7 +310,8 @@ class ParentAdmin(admin.ModelAdmin): | |||||||
|     model = Parent |     model = Parent | ||||||
|     inlines = [ChildInline] |     inlines = [ChildInline] | ||||||
|     save_as = True |     save_as = True | ||||||
|  |     list_display = ('id', 'name',) | ||||||
|  |     list_display_links = ('id',) | ||||||
|     list_editable = ('name',) |     list_editable = ('name',) | ||||||
|  |  | ||||||
|     def save_related(self, request, form, formsets, change): |     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_display_links = ('title',)  # 'id' not in list_display_links | ||||||
|     list_editable = ('content', ) |     list_editable = ('content', ) | ||||||
|     form = StoryForm |     form = StoryForm | ||||||
|     ordering = ["-pk"] |     ordering = ['-id'] | ||||||
|  |  | ||||||
|  |  | ||||||
| class OtherStoryAdmin(admin.ModelAdmin): | class OtherStoryAdmin(admin.ModelAdmin): | ||||||
|     list_display = ('id', 'title', 'content') |     list_display = ('id', 'title', 'content') | ||||||
|     list_display_links = ('title', 'id')  # 'id' in list_display_links |     list_display_links = ('title', 'id')  # 'id' in list_display_links | ||||||
|     list_editable = ('content', ) |     list_editable = ('content', ) | ||||||
|     ordering = ["-pk"] |     ordering = ['-id'] | ||||||
|  |  | ||||||
|  |  | ||||||
| class ComplexSortedPersonAdmin(admin.ModelAdmin): | class ComplexSortedPersonAdmin(admin.ModelAdmin): | ||||||
| @@ -710,7 +711,8 @@ class MainPrepopulatedAdmin(admin.ModelAdmin): | |||||||
|  |  | ||||||
|  |  | ||||||
| class UnorderedObjectAdmin(admin.ModelAdmin): | class UnorderedObjectAdmin(admin.ModelAdmin): | ||||||
|     list_display = ['name'] |     list_display = ['id', 'name'] | ||||||
|  |     list_display_links = ['id'] | ||||||
|     list_editable = ['name'] |     list_editable = ['name'] | ||||||
|     list_per_page = 2 |     list_per_page = 2 | ||||||
|  |  | ||||||
|   | |||||||
| @@ -913,11 +913,16 @@ class ChildOfReferer(ParentWithFK): | |||||||
|  |  | ||||||
|  |  | ||||||
| # Models for #23431 | # Models for #23431 | ||||||
|  | class InlineReferer(models.Model): | ||||||
|  |     pass | ||||||
|  |  | ||||||
|  |  | ||||||
| class ReferencedByInline(models.Model): | class ReferencedByInline(models.Model): | ||||||
|     name = models.CharField(max_length=20, unique=True) |     name = models.CharField(max_length=20, unique=True) | ||||||
|  |  | ||||||
|  |  | ||||||
| class InlineReference(models.Model): | class InlineReference(models.Model): | ||||||
|  |     referer = models.ForeignKey(InlineReferer, models.CASCADE) | ||||||
|     fk = models.ForeignKey( |     fk = models.ForeignKey( | ||||||
|         ReferencedByInline, |         ReferencedByInline, | ||||||
|         models.CASCADE, |         models.CASCADE, | ||||||
| @@ -926,10 +931,6 @@ class InlineReference(models.Model): | |||||||
|     ) |     ) | ||||||
|  |  | ||||||
|  |  | ||||||
| class InlineReferer(models.Model): |  | ||||||
|     refs = models.ManyToManyField(InlineReference) |  | ||||||
|  |  | ||||||
|  |  | ||||||
| # Models for #23604 and #23915 | # Models for #23604 and #23915 | ||||||
| class Recipe(models.Model): | class Recipe(models.Model): | ||||||
|     rname = models.CharField(max_length=20, unique=True) |     rname = models.CharField(max_length=20, unique=True) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user