5d65bf4bbc
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.