Commit Graph

53 Commits (b75e55b6f172aa32fda6481434681ae0450c82cb)

Author SHA1 Message Date
Alex Alvarez a16345874e Issue #213: Don't modify Q passed in as arguments 2016-06-02 01:10:43 -04:00
Austin Matsick 4aece2b5d3 #216 Use self._state.db instead of `using` kwarg in model methods.
Thanks to @vdboor for the suggestion.

Also:
- Add missing `using` kwargs in query_translate functions.
- Add a couple unit tests for non-default database functionality.
2016-05-30 18:55:03 -05:00
Austin Matsick 2f11cb6ffd #216 Specify `using` kwarg in get_real_instance method calls. 2016-05-29 14:05:45 -05:00
Austin Matsick 343aa41ec1 #216 Allow ContentType queries to be performed on non-default databases. 2016-05-27 20:35:39 -05:00
Diederik van der Boor 5aa15b226e Improve code flow for Django 1.7/1.8 in patch_lookup args 2016-03-11 17:16:05 +01:00
Diederik van der Boor 88922d7d5e Fix error when using `date_hierarchy` field in the admin
Closes: #201
2016-03-11 17:13:09 +01:00
Diederik van der Boor 6319dabcef Fix trailing whitespace in query.py 2016-03-11 17:13:01 +01:00
Diederik van der Boor 88bb23b506 Fix deferred loading of 'pk' field 2016-02-18 13:14:49 +01:00
Diederik van der Boor 4277c148aa Merge pull request #161 from theatlantic/pr-add-deferred-fields
Add support for qset.only() and qset.defer()
2016-02-17 11:14:48 +01:00
slide333333 9b7c2d72b7 Added test cases for complex expressions in aggregate/annotate 2016-01-21 15:32:28 +01:00
slide333333 c5d4687bb9 Support Django 1.8 complex expressions on aggregate/annotate 2016-01-21 13:21:21 +01:00
Frankie Dintino 6df1403de5 Add support for qset.only() and qset.defer() 2016-01-04 00:36:48 -05:00
Diederik van der Boor 009069a32b Avoid auto-proxying all methods to the queryset.
This is unwanted behavior, and django provides much better methods for
it instead. (PolymorphicQuerySet.as_manager() / PolymorphicManager.from_queryset()
2015-12-28 17:10:58 +01:00
Diederik van der Boor 50f21dfa43 Rename manager.py => managers.py for consistency 2015-12-28 17:10:42 +01:00
Diederik van der Boor b7431b2d06 Fix PEP8 block comment issues (E265) 2015-12-28 15:16:42 +01:00
Diederik van der Boor aaf06c71a5 Fix PEP8 whitespace issues
autopep8 -r polymorphic/ example/ -i
--select=E112,E113,E115,E116,E122,E123,E125,E127,E128,E201,E202,E203,E211,E225,E226,E227,E228,E231,E251,E261,E262,E271,E272,E273,E274,E301,E302,E303,E304,E309,E711,E713,W291,W293,W391
--exclude migrations,south_migrations

(line conditiation fixes: E123,E125,E122,E127,E128)
2015-12-28 15:16:29 +01:00
Jonas Haag 4da67a0fb6 Fix an issue with '.values()' queries 2015-12-16 10:31:36 -03:00
Jonas Haag 0b87a5ecc8 Fixed a Python >= 3.7 incompatibility (see PEP 479) 2015-12-16 10:31:36 -03:00
Jonas Haag 6cf187b2de Fix Django < 1.8 compatibility 2015-12-16 10:31:36 -03:00
Jonas Haag 24e6b21204 Fix a handful of warnings and remove some unused compatibility code 2015-12-16 10:31:36 -03:00
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