Commit Graph

760 Commits (f769ed756800140d210abb2a4d4413a1a68daa05)

Author SHA1 Message Date
Charlie Denton c6e58db73e
Use tox for travis builds
This paves the way for more complex tox configs that don't need
duplicated config.
2017-04-14 01:09:32 +01:00
Charlie Denton 24d7509879
Run django master in tox tests 2017-04-14 00:53:17 +01:00
Charlie Denton 7dfe58bb10
Remove duplicate line in tox config 2017-04-14 00:49:35 +01:00
Charlie Denton 64325d0f99
Do not allow failures on django 1.11 2017-04-13 00:18:31 +01:00
Charlie Denton f010c6ddf7
Get tests running on django 1.11
I'm a little concerned that this loses some of the efficiencies (in
particular, chunking) from previous versions. That's something that can
probably be improved.
2017-04-12 23:52:06 +01:00
Sobolev Nikita 72cc3d769d Updates README.rst with svg badge 2017-04-07 13:18:14 +03:00
Diederik van der Boor a568c04e40 Merge pull request #262 from pawelad/patch-1
Added 'z-index' attribute to '.polymorphic-type-menu' CSS class
2017-04-06 14:15:45 +02:00
Diederik van der Boor 7b9c02b53a Merge pull request #269 from fladi/documentation-contenttypes
Install django.contrib.contenttypes for docstrings.
2017-04-06 14:14:57 +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 490f968353 Merge pull request #268 from fladi/python3-docstrings
Replace force_unicode with force_text for Python3 compatibility.
2017-04-06 14:04:08 +02:00
Diederik van der Boor a3c9bcb14a Merge remote branch 'meshy/new-test-versions' 2017-04-06 13:57:07 +02:00
Diederik van der Boor fa74ce28e8 Start running tests on Django 1.11 (in allow_failures) 2017-04-06 12:53:18 +02:00
Diederik van der Boor d8cb700e58 Make sure tests can run in Django 1.11 2017-04-06 12:51:16 +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
Charlie Denton aefb7dabc2
Django 1.11 uses real class names in __repr__()
See https://code.djangoproject.com/ticket/27546 and
https://github.com/django/django/commit/48826aa
2017-03-03 22:56:09 +00:00
Charlie Denton 8e52bdf6d1
Explicitly name ids of clashing base models
This avoids the following error in django 1.11 tests:

    polymorphic.MRODerived: (models.E005) The field 'id' from parent model 'polymorphic.mrobase3' clashes with the field 'id' from parent model 'polymorphic.mrobase1'.

Related to https://code.djangoproject.com/ticket/22442
2017-03-03 22:16:54 +00:00
Charlie Denton a178ed751d
Test against Python 3.6 and Django 1.11b1 2017-03-03 22:16:54 +00:00
Michael Fladischer 0d6e448a99 Install django.contrib.contenttypes for docstrings.
This is merely cosmetic to avoid Django warning because of
`django.contrib.contenttypes` being referenced but not an installed app.
2017-03-01 15:21:23 +01:00
Michael Fladischer b0b4b826f5 Replace force_unicode with force_text for Python3 compatibility.
`force_unicode` has been [deprecated](https://docs.djangoproject.com/en/1.10/ref/utils/#django.utils.encoding.force_unicode) and replaced with `force_text`[0].
Furthermore, `force_unicode` is not available in Python3, causing the
documentation to be unbuildable with Python3 sphinx.
2017-03-01 15:16:07 +01:00
Paweł Adamczak 54b681c13b Added 'z-index' attribute to '.polymorphic-type-menu' CSS class 2017-02-06 15:06:58 +00:00
Diederik van der Boor c2aff50ecc Fix changelog date for 1.1 2017-02-06 13:37:05 +01:00
Diederik van der Boor 132e2cfdf9 Bump to v1.1 2017-02-03 22:08:48 +01:00
Diederik van der Boor 7dc2f93148 Added plain tests for admin importing 2017-02-03 22:05:13 +01: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 66619371fd remove empty test_models.py file 2017-02-03 22:05:13 +01:00
Diederik van der Boor e28d7cb9f5 Merge pull request #258 from n1ncha/master
Update advanced.rst
2017-02-03 21:49:02 +01:00
Diederik van der Boor ed09e4db93 Fixed Python 2.6 issue 2017-02-03 21:44:38 +01:00
n1ncha fb10deaa8c Update advanced.rst
fixed import for ShowFieldType
2017-01-18 11:32:26 -05:00
Diederik van der Boor d11bb17809 Bump to v1.1b: 2017-01-11 14:18:38 +01:00
Diederik van der Boor 04f2a62fd4 Revert get_real_concrete_instance_class_id() dry attempt
Caused by f9fffc44c1
2017-01-11 14:17:26 +01:00
Diederik van der Boor e06aa6ae80 Bump to v1.1b1 2017-01-10 17:19:44 +01:00
Diederik van der Boor 9cbfc7199b Add polymorphic_formset_tags library 2017-01-10 17:18:51 +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 c76cc663e0 docs: mention RunPython.noop and reset_polymorphic_ctype() 2017-01-09 15:34:45 +01:00
Diederik van der Boor cf663a0e07 Update reset_polymorphic_ctype, improve ignore_existing parameter 2017-01-09 15:32:52 +01:00
Diederik van der Boor add90aac4f Replace assertEquals -> assertEqual 2017-01-09 15:14:55 +01:00
Diederik van der Boor 1f15a72a80 Moved polymorphic models back to tests/__init__.py, for Django 1.6- 2017-01-09 15:12:26 +01:00
Diederik van der Boor 11a471ae01 Add reset_polymorphic_ctype() function to assist with migration to polymorphic 2017-01-09 14:42:41 +01:00
Diederik van der Boor b9f1709587 Update model paths in tests to new split test paths 2017-01-09 14:42:34 +01:00
Diederik van der Boor 9493bd8bc1 split tests.py into a python package 2017-01-09 14:41:56 +01:00
Diederik van der Boor 55de14b8f7 be explicit to ignore line length 2016-12-19 11:32:39 +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 695d352edb Add polymorphic.contrib.extra_views to combine polymorphic with django-extra-views 2016-11-30 11:56:12 +01:00
Diederik van der Boor 186f9548b1 Bump to v1.0.2 2016-10-14 11:51:03 +02:00
Diederik van der Boor 58f89efa5d Brush up the `ParentAdminNotRegistered` fix a bit for flow clarity. 2016-10-14 11:51:03 +02:00
Diederik van der Boor 3570d10754 Merge pull request #246 from ixc/feature/fix-non-root-parent-admin-lookup
Fix get parent admin when intermediate not root ctype model is registered
2016-10-14 11:40:10 +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 db6d7ed213 Update changelog with recent git changes 2016-10-04 11:21:20 +02:00