Commit Graph

83 Commits (8b35063f58ceade5d5af42f955ae2c0fdb7128fc)

Author SHA1 Message Date
Diederik van der Boor 2ffbd51844 Added as_manager() support for querysets 2015-10-01 14:26:28 +02:00
Sander van Leeuwen ed55ceb7fa Fix Pickle exception when polymorphic model is cached
fixes issue #155
2015-09-04 16:51:22 +02:00
tyaslab 135feaf905 fixed 'source_expressions'
(cherry picked from commit 9a34a2a5017499bb12512b2387de49aa2c40fc88)
2015-04-08 13:44:35 +02:00
Diederik van der Boor c947c3dec1 Merge pull request #119 from theatlantic/child-model-custom-pk-bug
Bug with queryset results on base model where child model has a custom primary key
2015-04-08 13:09:35 +02:00
Frankie Dintino 1be1fc02db Fix missing items bug in qset on child of PolymorphicModel w custom pk
fixes #66
2015-01-31 17:11:03 -05:00
ellmetha 469d063cc9 Django 1.8 alpha support 2015-01-28 00:41:34 +01:00
Diederik van der Boor e1093ff1fb Fix .non_polymorphic(), returns a copy of the queryset
Just like .filter() and such do.
2013-09-19 19:36:05 +02:00
Gavin Wahl 71767431eb Django 1.6 support
CHUNK_SIZE has been removed from Django, so set it ourself if it can't
be imported.
2013-05-24 15:13:34 -06: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 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
Adam Wentz 04dce421e5 Fixes PolymorphicQuerySet for django 1.6
QuerySet.dup_select_related has been removed.
2013-04-08 00:35:22 +02:00
Diederik van der Boor bb0a4daddc Optimize transmogrify() function, assign __class__ instead. 2013-04-08 00:32:06 +02:00
Jedediah Smith 1a6f3a45e5 Handle non-distinct results from base object query 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
Jedediah Smith 58c4f6f697 Optimization - don't do extra queries for proxy models 2013-04-08 00:05:21 +02:00
Jedediah Smith e2cfbf3898 Support proxy models (still requires one query per proxied model, not optimal) 2013-04-07 23:36:09 +02:00
Ben Konrath dc6f41c7e9 Update URLs to github hosted webpage. 2013-03-18 21:27:23 +01:00
German M. Bravo f987818fe4 PEP 8 cleaning
Conflicts:

	polymorphic/__init__.py
	polymorphic/polymorphic_model.py
2011-12-20 18:59:50 +00:00
German M. Bravo c9922d8987 PEP 8 cleaning 2011-12-20 18:59:50 +00:00
German M. Bravo bb06d6d12b Some more PEP 8 cleaning 2011-12-20 18:59:25 +00:00
Jonas Obrist 6f8e31222d PEP-8, it's a thing! 2011-05-19 06:05:49 -07:00
Bert Constantin 2c47db8fcc Fixed github issue 15 (query result incomplete with inheritance). Thanks to John Debs. 2011-01-24 17:03:23 +01:00
Bert Constantin a4ac6cc91d fix object retrieval problem occuring with some custom primary key fields
+ added UUIDField as test case
2010-11-02 12:21:22 +01:00
Bert Constantin 6befe6c733 added "queryset.get_real_instances()" usage, added testcase 2010-11-02 12:10:02 +01:00
Bert Constantin 8c3df56cb6 non_polymorphic() queryset member function added 2010-10-23 12:22:13 +02:00
Bert Constantin 19adbdaf2c extra(): Re-implemented. Now is polymorphic (nearly) without restrictions.
Added test cases + docs.
2010-10-23 11:52:04 +02:00
Bert Constantin 6c8d28cbbc extra(): throw error if unsupported argument is encountered, support 'params' argument, special case Django 1.1 2010-10-22 13:37:26 +02:00
Abel Daniel 486a579ac7 Make .extra() only disable polymorphic query if an arg that is currently
not handled is actually used. I.e. if all args are supported, then
do polymorphic query by default.
2010-10-22 13:35:50 +02:00
Bert Constantin f05b854a54 make PolymorphicQuerySet.get_real_instances() an official part of the API 2010-10-20 09:31:42 +02:00
Bert Constantin b1905026bc Documentation updated.
Test_all_versions script added.
Some minor misc changes.
Added polybench.
2010-10-20 09:31:36 +02:00
Bert Constantin c10ff1650b added translate_polymorphic_Q_object 2010-10-19 21:28:33 +02:00
Bert Constantin 01bdb2f9b0 - renamed ShowField* to ShowFieldType, ShowFieldContent, ShowFieldTypeAndContent, in order to reflect better what they do.
- by default, django_polymorphic's pretty printing of querysets/objects (via ShowField*) is not used anymore
- ShowField mixins now also show the annotations (after the regular fields, prepended by "Ann:")
- cleaned up implementation.
2010-10-19 21:28:33 +02:00
Bert Constantin 116e2af08b IMPORTANT: import path changed, it's now: "from polymorphic import PolymorphicModel, ..."
- added python2.4 compatibility. Contributed by Charles Leifer. Thanks!
- general reorganization of the code - there is no single polymorphic.py module anymore,
  so d-p now needs to be installed as a regular Django app
- polymorphic.VERSION/get_version added
- version numbering started: V0.5 beta
2010-02-22 16:16:00 +01:00