Commit Graph

19 Commits (f85ebdd9e6ed916149d8f3f739cbfd5d1bf34be5)

Author SHA1 Message Date
Diederik van der Boor b5774423f7 Improve on #69, using setdefault() and update example project
Camp site rule; leave things tidier than you found them :)
2014-04-03 14:27:56 +02:00
Evan Borgstrom d93add71fb Be more specific in the condition before setting 'fields' 2014-03-13 16:50:25 -04:00
Evan Borgstrom 134c44bef0 Prevent infinite recursion in Django 1.6 2014-03-13 16:39:13 -04:00
Diederik van der Boor a8d27ca94e Pass ``/admin/app/model/ID/...`` URLs to the correct admin backend.
Using the ID field, the correct ``ct_id`` parameter can already be
determined.
2013-09-17 11:02:38 +02:00
Diederik van der Boor e0446bd76c Fix TypeError when ``base_form`` was not defined. 2013-09-17 10:50:46 +02:00
Diederik van der Boor 638ecd5813 Fix admin validation errors related to additional non-model form fields. 2013-09-05 11:36:54 +02:00
Diederik van der Boor b2be0701ca Fix missing permission check in the "add type" view.
The permissions were checked in the next step,
so this didn't cause a security issue.
2013-08-20 12:07:29 +02:00
Bertrand Bordage 40eeb15fad Simplifies add_type_form.html. See #38. 2013-06-07 13:39:33 +02:00
Tomas Peterka cbf52a61af Porting to Python 3.2
Removed compatibility_tools (because we aim to Python 2.7 and Python 3.2)
Performed 2to3 and modified
Usage of django.utils.six which adds dependency on Django >= 1.4.2
2013-05-20 16:03:21 +02:00
Diederik van der Boor 4106ad7296 Apply list filter in example app 2013-04-08 00:37:51 +02:00
floppya a214cd58f7 Adds admin list filter for polymorphic child models. 2013-04-08 00:35:55 +02:00
floppya 20ac209dbb Fixes proxy models in the admin
The PolymorphicParentModelAdmin was getting the concrete model ids for
the add form.
2013-04-08 00:32:06 +02:00
Julian Wachholz a6f8429aae django.conf.urls.defaults is deprecated; use django.conf.urls instead 2013-04-04 23:41:07 +03:00
Diederik van der Boor 0d5f2fd943 Change the child model registration to fix raw_id_fields.
As discovered in django-polymorphic-tree and django-fluent-pages,
the raw_id_fields didn't work in Django 1.4 because the fields actively
check which models are actually registered in the admin site.

Hence, the parent admin site _registry is inserted in the child admin as
well. This also completely moves the initialisation of the child admin
into this class, using a `get_child_models()` function,
akin to the static `child_models` attribute.
2012-07-24 21:50:52 +02:00
Diederik van der Boor 0b608cc67e Minor extension: allow apps to override the type label in the add form easily
When overriding apps, this turns out to be a very useful feature to
have.
2012-07-18 00:51:34 +02:00
Diederik van der Boor 8d426d9243 Remove abc marker because methods are no longer abstract 2012-07-13 18:29:02 +02: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 2e76811adb Adding PolymorphicChildModelAdmin to __all__ as well 2012-07-05 23:27:34 +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