Please sign in to comment.
Added polymorphic admin interface
Extracted from django-fluent-pages, ready for other apps too. The polymorphic admin is implemented via a parent admin for the base model, and separate admin interfaces for the child models. The parent model needs to inherit PolymorphicParentModelAdmin, and override `get_admin_for_model()` and `get_child_model_classes()` to find the child admin interfaces. The derived models have their own `ModelAdmin` class, which inherits from `PolymorphicChildModelAdmin`. The parent admin redirects it's change and delete views to the child admin. By adding `polymorphic` to the INSTALLED_APPS, the breadcrumbs will be fixed as well, to remain unchanged between the child applications.
- Loading branch information...
Showing with 551 additions and 0 deletions.
- +1 −0 AUTHORS.rst
- +6 −0 CHANGES.rst
- +101 −0 DOCS.rst
- +361 −0 polymorphic/admin.py
- +15 −0 polymorphic/templates/admin/polymorphic/change_form.html
- +15 −0 polymorphic/templates/admin/polymorphic/delete_confirmation.html
- 0 polymorphic/templatetags/__init__.py
- +52 −0 polymorphic/templatetags/polymorphic_admin_tags.py
Oops, something went wrong.