Commit Graph

5 Commits (570e44047717df1fdced4d6ebb076467d2fa864f)

Author SHA1 Message Date
Bertrand Bordage 2421f10ab5 Simplifies the two remaining templates (for grappelli support). 2013-07-18 16:38:14 +02:00
Bertrand Bordage 40eeb15fad Simplifies add_type_form.html. See #38. 2013-06-07 13:39:33 +02:00
Diederik van der Boor 720a189f5a Remove unused load statements in add_type_form.html
This addresses Django 1.5 compatibility as well (see #16)
2013-03-18 12:15:10 +01:00
Diederik van der Boor b2e308d30c Improve PolymorphicParentAdmin, simplify, fix templates
During the development of django-polymorphic-tree it was discovered that
the PolymorphicParentModelAdmin could actually be made much simpler.
It features a `child_models` attribute now, so there is very little code
needed to actually implement a polymorphic admin now.

Also found various issues which are together fixed in this commit for
pulling.
2012-07-13 16:01:58 +02:00
Diederik van der Boor 5d65bf4bbc 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.
2012-07-05 23:16:46 +02:00