Charlie Denton
840bfe8d22
Fix import in Django 2.0
...
Because the URL mechanism has changed in Django 2.0, the
RegexURLResolver has been renamed.
2018-01-16 10:53:34 +00:00
Tadas Dailyda
180df8e98c
fix detecting whether childadmin has explicitly defined fields/fieldsets
2017-11-20 17:39:34 +02:00
Tadas Dailyda
15426dc695
further childadmin fieldsets improvements
2017-11-20 17:38:02 +02:00
Diederik van der Boor
02b71d8ba9
Improve fix of PR #321
...
checking hasattr(self, 'fieldsets') alway returns true, and produces
different effects. The hasattr(self, 'declared_fieldsets') was designed
to detect whether Django injected that attribute.
Amends: 5e150ea85a
2017-11-20 15:22:58 +01:00
Tadas Dailyda
5e150ea85a
do not use deprecated and removed declared_fieldsets attribute in admin
2017-11-02 15:13:17 +02:00
Diederik van der Boor
c2768f8101
Fix support for proxy models in formsets and admin inlines
2017-10-08 22:43:54 +02:00
Diederik van der Boor
cafaf95f06
Add UnsupportedChildType error for formsets
...
This also replaces the PolymorphicInlineModelAdmin.get_get_child_inline_instance()
and BasePolymorphicModelFormSet._construct_form() lookup with UnsupportedChildType
2017-10-08 22:33:01 +02:00
Diederik van der Boor
3fe17d7a23
Provide helpful assistence to migrate code to new 1.0+ format
...
This makes sure the changes in 4dc20a0213
don't cause a new range of bug reports, for things like "reverse()" no
longer works.
2017-10-08 19:40:39 +02:00
Diederik van der Boor
8caac2e57b
Fixed the polymorphic inline script code.
...
Got broken in 0c7b1aa657 when removing
Djagno 1.8 compatibility
2017-09-30 16:50:12 +02:00
Diederik van der Boor
c437524876
Improve docs of PolymorphicChildModelAdmin attributes
2017-09-30 16:35:21 +02:00
Diederik van der Boor
cf0cb2478f
Make the admin `base_model` setting optional.
...
It can be detected using get_base_polymorphic_model()
2017-09-30 16:35:02 +02:00
Omer Strumpf
bc11934c31
allowing extra arguments in get_inline_formsets
2017-09-28 12:22:13 +03:00
Jerome Leclanche
6fe1e2ddae
Update django.urls imports
2017-08-29 19:41:42 +03:00
Jerome Leclanche
4dc20a0213
Remove Pre-1.0 compatibility hacks
2017-08-29 19:41:42 +03:00
Jerome Leclanche
0c7b1aa657
Drop support for Django 1.8
2017-08-29 19:41:42 +03:00
Diederik van der Boor
fe0880e413
Merge pull request #300 from nazarewk/patch-1
...
`declared_fieldsets` typo fix
2017-08-01 11:38:13 +02:00
Diederik van der Boor
67dd5c0a0d
Reverted int/long change, as Django's BigIntegerField can produce longs on Python 2
2017-07-10 10:57:07 +02:00
Jerome Leclanche
0a495cb485
Fix PolymorphicParentModelAdmin.pk_regex escape
2017-07-10 09:08:11 +03:00
Jerome Leclanche
298460c4cf
Drop support for Django <1.8, Python <2.7
2017-07-10 09:08:11 +03:00
Krzysztof Nazarewski
697df65c7b
`declared_fieldsets` typo fix
2017-07-05 13:45:28 +02:00
Diederik van der Boor
a8bfb5007e
Fix TypeError on Python 3 when querystring is preserved in the admin.
...
Fixes : #263
2017-04-06 14:13:56 +02:00
Diederik van der Boor
cd38e785b2
Add an explicit exclude for polymorphic_ctype in the PolymorphicInlineModelAdmin
2017-04-06 12:47:28 +02:00
Diederik van der Boor
b691533039
Fix import errors with Django 1.6 code
2017-02-03 22:05:13 +01:00
Diederik van der Boor
f9fffc44c1
Add API documentation to the package!
2017-01-09 16:53:50 +01:00
Diederik van der Boor
4aa3355f5c
flake8 fixes
2016-12-19 11:28:41 +01:00
Diederik van der Boor
3170ea95c2
autoflake: remove unused imports and statements
2016-12-19 11:12:40 +01:00
Diederik van der Boor
1d13b4f3c5
autopep8, except line length
2016-12-19 11:10:03 +01:00
Diederik van der Boor
58f89efa5d
Brush up the `ParentAdminNotRegistered` fix a bit for flow clarity.
2016-10-14 11:51:03 +02:00
James Murty
37f92b3a3f
Fix get parent admin when intermediate not root ctype model is registered
...
This change fixes an issue where django-polymorphic raises a
`ParentAdminNotRegistered` exception when you register an admin for a
child model ancestor, but not for the root ancestor as pointed to by
the `polymorphic_ctype` field. This error occurs only when you *Save*
the child model detail form, not when you *Save and continue* on that
same form.
This situation occurs for us when using django-fluent-pages version
1.0.1 which has an intermediate `Page` model registered with a parent
admin to show the pages listing. The existing `_get_parent_admin` method
expects an admin to be registered for the root `UrlNode` model pointed
to by the `polymorphic_ctype` field.
This fix uses a potentially naive and slow brute-force approach where
it walks up the class hierarchy and checks whether a parent admin is
registered for each ancestor model, unless/until it finds one.
See also https://github.com/ic-labs/django-icekit/issues/31/
2016-10-13 09:35:13 +11:00
Diederik van der Boor
8811c177bd
remove unneeded import
2016-08-15 16:10:55 +02:00
Diederik van der Boor
83cb059317
Fix marking a new formset item as empty-form on postback errors
2016-08-15 16:03:08 +02:00
Diederik van der Boor
352b56e104
Merge branch 'feature/inlines'
2016-08-10 11:48:02 +02:00
Diederik van der Boor
60db4f63b9
Update polymorphic inline script.
...
Now based on standard Django script.
This makes upgrading it to newer Django versions much easier.
Changes for polymorphic are included in this commit
2016-08-10 11:45:48 +02:00
Diederik van der Boor
59e3878835
Add detection for missing PolymorphicInlineSupportMixin
2016-08-09 01:21:37 +02:00
Diederik van der Boor
7330a4f099
Add preliminairy working JavaScript to render polymorphic inlines
2016-08-09 01:20:40 +02:00
Diederik van der Boor
1f0ddd8436
Rename inline/formset classes to avoid more confusion.
...
AbstractSingletonProxyFactoryBean danger luked here...
Added the Stacked...Inline for clarity too.
2016-08-09 01:11:05 +02:00
Diederik van der Boor
ac98a8123a
Raise ParentAdminNotRegistered instead of KeyError
2016-07-08 12:06:04 +02:00
Tadas Dailyda
0edd0d4acd
fix redirects after child model add/change in PolymorphicChildModelAdmin
2016-06-14 19:17:04 +03:00
Diederik van der Boor
c1ee5aad0b
Improve #215 to handle cases where the real_admin points back to self.
...
When the base model also serves as child model, the flow no longer
points to the child admin, but returns `self` instead. Either every user
of `_get_real_admin()` should detect this, or we return the super method
as convenience.
2016-06-13 10:53:29 +02:00
Diederik van der Boor
8c42893abd
docs start for formset/inline support
2016-06-13 10:18:18 +02:00
Diederik van der Boor
a07ce7260c
Upstream support for polymorphic formsets and and inline models.
...
Originally written in django-fluent-contents to support polymorphic generic inlines;
72d816b8bb
2016-06-10 14:30:51 +02:00
Diederik van der Boor
2a599b5f99
Convert `admin.py` into a package.
...
Clears up the code and prepare to receive more changes for formset support.
2016-06-10 14:25:06 +02:00