Improve on #69, using setdefault() and update example project

Camp site rule; leave things tidier than you found them :)
This commit is contained in:
Diederik van der Boor
2014-04-03 14:26:15 +02:00
parent 08e900eb6d
commit b5774423f7
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -6,6 +6,14 @@ from pexp.models import *
class ProjectChildAdmin(PolymorphicChildModelAdmin):
base_model = Project
# On purpose, only have the shared fields here.
# The fields of the derived model should still be displayed.
base_fieldsets = (
("Base fields", {
'fields': ('topic',)
}),
)
class ProjectAdmin(PolymorphicParentModelAdmin):
base_model = Project
list_filter = (PolymorphicChildModelFilter,)