summaryrefslogtreecommitdiff
path: root/tests/admin_views/admin.py
diff options
context:
space:
mode:
authorAlexander Gaevsky <sasha@sasha0.ru>2016-01-09 22:15:21 +0200
committerTim Graham <timograham@gmail.com>2016-01-21 13:21:28 -0500
commit9a33d3d76497d9e198de942ee1236c452231262f (patch)
treec0ab5010e5d9a074a45d7ad4bc03d76eaaea01e3 /tests/admin_views/admin.py
parentfb4272f0e6bbdaa3e19ed5fde59fdb5ab5a33baf (diff)
Fixed #26060 -- Fixed crash with reverse OneToOneField in ModelAdmin.readonly_fields.
Diffstat (limited to 'tests/admin_views/admin.py')
-rw-r--r--tests/admin_views/admin.py24
1 files changed, 15 insertions, 9 deletions
diff --git a/tests/admin_views/admin.py b/tests/admin_views/admin.py
index dbc77e2f7c..932a29f3ac 100644
--- a/tests/admin_views/admin.py
+++ b/tests/admin_views/admin.py
@@ -35,15 +35,16 @@ from .models import (
InlineReference, InlineReferer, Inquisition, Language, Link,
MainPrepopulated, ModelWithStringPrimaryKey, NotReferenced, OldSubscriber,
OtherStory, Paper, Parent, ParentWithDependentChildren, ParentWithUUIDPK,
- Person, Persona, Picture, Pizza, Plot, PlotDetails, PluggableSearchPerson,
- Podcast, Post, PrePopulatedPost, PrePopulatedPostLargeSlug,
- PrePopulatedSubPost, Promo, Question, Recipe, Recommendation, Recommender,
- ReferencedByGenRel, ReferencedByInline, ReferencedByParent,
- RelatedPrepopulated, RelatedWithUUIDPKModel, Report, Reservation,
- Restaurant, RowLevelChangePermissionModel, Section, ShortMessage, Simple,
- Sketch, State, Story, StumpJoke, Subscriber, SuperVillain, Telegram, Thing,
- Topping, UnchangeableObject, UndeletableObject, UnorderedObject,
- UserMessenger, Villain, Vodcast, Whatsit, Widget, Worker, WorkHour,
+ Person, Persona, Picture, Pizza, Plot, PlotDetails, PlotProxy,
+ PluggableSearchPerson, Podcast, Post, PrePopulatedPost,
+ PrePopulatedPostLargeSlug, PrePopulatedSubPost, Promo, Question, Recipe,
+ Recommendation, Recommender, ReferencedByGenRel, ReferencedByInline,
+ ReferencedByParent, RelatedPrepopulated, RelatedWithUUIDPKModel, Report,
+ Reservation, Restaurant, RowLevelChangePermissionModel, Section,
+ ShortMessage, Simple, Sketch, State, Story, StumpJoke, Subscriber,
+ SuperVillain, Telegram, Thing, Topping, UnchangeableObject,
+ UndeletableObject, UnorderedObject, UserMessenger, Villain, Vodcast,
+ Whatsit, Widget, Worker, WorkHour,
)
@@ -866,6 +867,10 @@ class InlineRefererAdmin(admin.ModelAdmin):
inlines = [InlineReferenceInline]
+class PlotReadonlyAdmin(admin.ModelAdmin):
+ readonly_fields = ('plotdetails',)
+
+
class GetFormsetsArgumentCheckingAdmin(admin.ModelAdmin):
fields = ['name']
@@ -920,6 +925,7 @@ site.register(Villain)
site.register(SuperVillain)
site.register(Plot)
site.register(PlotDetails)
+site.register(PlotProxy, PlotReadonlyAdmin)
site.register(Bookmark)
site.register(CyclicOne)
site.register(CyclicTwo)