Commit Graph
67 Commits
Author SHA1 Message Date
Diederik van der Boor 9d00d214e1 Fix unwanted ___ handling when a fieldname starts with an underscore. 2013-07-22 10:21:00 +02:00
Diederik van der Boor d16f2d7590 Add changelog entry for Grappelli fix. 2013-07-18 21:17:00 +02:00
Diederik van der Boor cdc9b16aa8 Merge pull request #44 from BertrandBordage/master
Grappelli support & django-reversion support documentation.
2013-07-18 12:14:40 -07:00
Diederik van der Boor 2138b7f2ac Fix Travis build for Django 1.6-git 2013-07-05 12:15:50 +02:00
Diederik van der Boor 19d226cd97 Bump version to 0.5.1 final 2013-07-05 12:09:31 +02:00
Diederik van der Boor 07f6b6eaa1 Add tox django-dev version test 2013-07-05 12:07:41 +02:00
Diederik van der Boor 77139ba2d3 Add tox test for docs
And ignore the warning about changelog_archive, it's really not meant to
be in the toctree.
2013-07-05 12:07:19 +02:00
Diederik van der Boor f34499a474 Add ChangeLog entry for Grappelli fix 2013-07-05 12:06:45 +02:00
Diederik van der Boor 53f6fd76ee Merge pull request #39 from BertrandBordage/master
Simplifies add_type_form.html. See #38.
2013-07-05 02:24:21 -07:00
Diederik van der Boor f17493ebb9 Merge pull request #35 from fusionbox/django1.6
Another fix for Django 1.6 support

This addresses the removal of CHUNK_SIZE due to https://code.djangoproject.com/ticket/18702 in django/django@70679243d1
2013-05-25 05:07:23 -07:00
Diederik van der Boor ef1feab709 Enable coveralls for testing 2013-05-22 10:58:18 +02:00
Diederik van der Boor ff22332d2c Remove Django 1.1 compatibility switch 2013-05-20 23:54:45 +02:00
Diederik van der Boor fed810b336 Update version numbers for 0.5 release 2013-05-20 18:03:35 +02:00
Diederik van der Boor 6ea15d87d6 Update Travis image in README 2013-05-20 18:02:54 +02:00
Diederik van der Boor 9b171e9ba2 docs: mention Python 3 support in quickstart 2013-05-20 17:57:00 +02:00
Diederik van der Boor 795441eed3 README typoo 2013-05-20 17:54:20 +02:00
Diederik van der Boor efe54284bc Mention RTD link in documentation too. 2013-05-20 17:53:49 +02:00
Diederik van der Boor e2027c3112 Improve README example 2013-05-20 17:51:53 +02:00
Diederik van der Boor 978b46fe93 Also update polymorphic version in the docs 2013-05-20 17:35:06 +02:00
Diederik van der Boor 393f7c5f30 Python 3.2 support confirmed. 2013-05-20 17:34:09 +02:00
Diederik van der Boor 83238697d2 Setup.py: update trove classifiers, read version from code. 2013-05-20 17:12:38 +02:00
Diederik van der Boor 6a32ffbf98 Docs: mention python 3 support 2013-05-20 17:12:25 +02:00
Diederik van der Boor fbcd68a220 Travis: don't test Django 1.4 against Python 3 2013-05-20 16:59:56 +02:00
Diederik van der Boor 4d7d33ed0d Port new code to Python 3 as well, fix six.with_metaclass() issues
Many thanks to @atheiste for the big porting steps!
2013-05-20 16:03:21 +02:00
Diederik van der Boor 73c378a369 docs: remove tar file reference 2013-05-20 16:03:07 +02:00
Diederik van der Boor 705e7fc037 Fix the changelog date of version 0.2 2013-05-19 20:51:29 +02:00
Diederik van der Boor 93a6592649 Mention the word "inherited models" in the docs more often
..to give some SEO juice to the project because developers are looking
for "inherited models" instead of "polymorphism".
2013-05-19 17:19:24 +02:00
Diederik van der Boor c933be9c24 Port documentation to Sphinx, cleanup README 2013-05-19 17:15:41 +02:00
Diederik van der Boor 8cf313335c Handle stale ContentType models (no longer referring to a model)
This builds on top of a fix in Django 1.6, and has a workaround for
Django 1.4 and 1.5. When the base class points to a model that no longer
exists, it will be silently dropped in the polymorphic queryset results.

This behavior is identical to iterating over results when the derived
table doesn't have the object anymore.
2013-05-19 14:35:29 +02:00
Diederik van der Boor 762265e28a Travis: avoid bombarding IRC with everyone's fork 2013-04-08 12:28:33 +02:00
Diederik van der Boor 2e109101fc Fix and update Travis configuration 2013-04-08 11:38:20 +02:00
Diederik van der Boor 7889293227 Applied an overal cleanup of the .gitignore file 2013-04-08 11:30:50 +02:00
Diederik van der Boor ec1fd53974 Added Adam en Jedediah to AUTHORS for their contributions! 2013-04-08 11:29:55 +02:00
Diederik van der Boor 4106ad7296 Apply list filter in example app 2013-04-08 00:37:51 +02:00
Diederik van der Boor 7c2fb9dbfa Merge branch 'proxy_models_15' - add proxy model support! 2013-04-08 00:32:55 +02:00
Diederik van der Boor bb0a4daddc Optimize transmogrify() function, assign __class__ instead. 2013-04-08 00:32:06 +02:00
Diederik van der Boor a0ab068449 Included Proxy models in example app. 2013-04-08 00:32:06 +02:00
Diederik van der Boor ea9cb91e78 Rename variables in polymorphic/query.py for clarity
(split from previous commit by @jedediah)
2013-04-08 00:32:06 +02:00
Diederik van der Boor 19d5ed2338 Fix base_manager unit test
As more methods are added to the PolymorphicModel, the attr dict changes
ordering in the meta class. By making the ordering of managers
consistent, this problem no longer occurs.
2013-04-08 00:32:02 +02:00
Diederik van der Boor 12e6278741 Merge pull request #33 from vdboor/fix_related_queryset
Fix related queryset (please merge before #32)
2013-04-07 14:35:24 -07:00
Diederik van der Boor 38a230891c Merge pull request #31 from vdboor/django15
Fix Django 1.5 (proxy models broke polymorphism)
2013-04-07 14:33:49 -07:00
Diederik van der Boor 78253bfe12 Fix passing custom querysets to related managers.
* The custom manager was not assigned to _default_manager;
  get_first_user_defined_manager() always returned None
* The PolymorphicManager couldn't remember it's custom queryset;
  a RelatedManager creates a new instance of a manager, so the queryset
  parameter should be known at class-level, not object level.
* The old method of providing a custom queryset class has been deprecated.
2013-04-07 01:39:58 +02:00
Diederik van der Boor 1f26302632 Fix Django 1.5 support, tests pass again.
The reason polymorphic broke was because it couldn't find some managers
anymore in the inheritance tree. Django 1.5 removes these and replaces
them with an `AbstractManagerDescriptor`. This patch restores those objects
2013-04-07 00:43:41 +02:00
Diederik van der Boor ca4067e279 Add proxy model test that fails in Django 1.5 2013-04-05 17:36:50 +02:00
Diederik van der Boor e411660b80 Tests: fix missed error in last commit
(cannot amend, already pushed for review)
2013-04-05 12:01:44 +02:00
Diederik van der Boor ebced5f4eb Tests: make old code more readable 2013-04-05 11:45:07 +02:00
Diederik van der Boor 7ca328f9e4 Tests: auto removed unused imports 2013-04-05 11:39:57 +02:00
Diederik van der Boor 2d83124f51 Tests: remove Django 1.1 compatibility check 2013-04-05 11:38:56 +02:00
Diederik van der Boor 25aa32d7bd Replaced the doctests with unit tests
Making debugging tests much easier. The same repr() logic is preserved,
so this is essentually a huge coding style change.
2013-04-05 11:33:41 +02:00
Diederik van der Boor 32426aa41a Use self.assertEqual() in tests instead of assert statement. 2013-04-05 09:54:48 +02:00
Diederik van der Boor 1df5b5ff03 Add runtests script
Allow `python setup.py test` too.
Fix tox invocation now that `manage.py` has moved.
2013-04-05 09:52:53 +02:00
Diederik van der Boor e7a2340723 Remove polymorphic_dumpdata command and assorted scripts.
The polymorphic_dumpdata command carried a deprecation note for a long
time now. The scripts for testing python versions are replaced by tox already.
2013-03-28 14:16:45 +01:00
Diederik van der Boor 06ac5a4795 Convert Django project files in the root to example project.
Move pexp project to 'example' folder too.
2013-03-28 14:16:45 +01:00
Diederik van der Boor addf2854e1 Cleanup pexp commands, remove direct settings import 2013-03-28 13:52:44 +01: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 f687dc18b1 SQL optimization, avoid query in pre_save_polymorphic()
This query is visible in the django-debug-toolbar POST redirect page
2012-11-15 10:42:02 +01:00
Diederik van der Boor bba8db1210 Also update the DOCS for the get_child_models() admin change. 2012-07-24 21:55:01 +02: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 d5b1b6b56c Fix settings.py for Django 1.4 2012-07-13 17:44:37 +02:00
Diederik van der Boor a6d62ed630 Update the example app to demonstrate the polymorphic admin
This really begs for a separate folder, but I leave that to a new commit
for now.
2012-07-13 16:01:58 +02:00
Diederik van der Boor 42d525a895 Added url in setup.py, so sdist actually works again. 2012-07-13 16:01:58 +02:00
Diederik van der Boor 0950b86ca9 Added requires files to MANIFEST.in and setup.py 2012-07-13 16:01:58 +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