Commit graph

90 commits

Author SHA1 Message Date
Hanley Hansen
18dfb6b2cf
Merge pull request #279 from hanleyhansen/inheritance-iterable
Update InheritanceIterable to inherit from ModelIterable instead of BaseIterable
2018-05-02 14:14:22 -04:00
Tony Narlock
c4d72123ef rm use_for_related_fields #290 2017-12-07 12:20:50 -06:00
Tony Narlock
a07140e771 Use _chain for django 2.0, #295 2017-12-07 11:13:39 -06:00
Hanley
0a809df4da make InheritanceIterable inherit from ModelIterable instead of BaseIterable 2017-06-23 09:51:32 -04:00
Sachi King
8cb21aabbc Support django 1.11 iterator changes
Django starting with 1.9 switched to using a class to provide an
iterator for the querymanager.  Between 1.9 and 1.10 changes slowly
stopped referencing that function and instead started calling
_iterator_class directly.

As the functionality model-utils is patching has moved, this patch moves
the iterator logic to a class to match the changes that have been made
in Django in version 1.9.

As Django 1.8 is a LTS release that is still supported, iterator()
is retained in the InheritanceQuerySetMixin and can be removed when
support for Django 1.8 is removed.  This goes for the try-except in the
import statements as well.
2017-04-02 21:53:15 +10:00
Romain G
d07b992b94 Drop old get_query_set syntax, replaced by get_queryset now 2017-01-12 18:34:47 +00:00
Ryan P Kilby
e148c670d1 Fix django 2.0 warnings 2017-01-12 12:16:46 -05:00
Ryan P Kilby
fda2d39ec4 Drop unsupported django versions 2017-01-12 12:16:40 -05:00
Bruno Alla
2af54972eb Revert unrelated change regarding related fields
Remove attribute use_for_related_fields in SoftDeletableManagerMixin.
2017-01-05 18:32:13 +00:00
Bruno Alla
063332643d Split SoftDeletableQuerySet/Manager into Mixin 2017-01-05 14:40:03 +00:00
Bruno Alla
0efaad1218 Fix issue when extend QuerySet and Manager - fixes #249 2017-01-05 14:29:35 +00:00
Radosław Ganczarek
9e90dde2e8 Add SoftDeletableModel 2016-09-12 15:11:34 +02:00
Artis Avotins
d1337d5a7c Fixed a bug with Django >= 1.9 where values_list was called on
InheritanceQuerySet with `select_subclasses` applied as strings
raised AttributeError exception.

Adds a new test case `test_dj19_values_list_on_select_subclasses`
2016-05-25 18:58:03 +02:00
Adam Bogdał
4f39ce9497 Add support for Django 1.10 2016-02-09 00:22:12 +01:00
Karl WnW
ce8deed5ca Fix _clone signature for Django<1.9
InheritanceQuerySetMixin._clone signature conflicts with django
ValuesQuerySet._clone code which calls super like this:
"c = super(ValuesQuerySet, self)._clone(klass, **kwargs)"
2015-11-02 17:52:43 +01:00
jarekwg
bbad2b7b47 Hide _clone params in kwargs to match django 1.9 signature 2015-10-29 02:00:49 +11:00
jarekwg
2824ec2e48 Remove PassThroughManager
As of Django 1.7, QuerySet.as_manager() achieves the same result.
2015-10-29 00:10:28 +11:00
Carl Meyer
3f9b1cfac8 Fix select_subclasses for Django 1.8. 2015-01-27 16:48:06 -07:00
Keryn Knight
8a1d0662f1 Provide dir() support for PassThroughManagers.
Reported in #55 by erikcw.
2014-04-15 08:48:01 +01:00
Matthew Schinckel
93500bb381 Ensure we call get_query_set on django 1.5-
Supersedes https://github.com/carljm/django-model-utils/pull/106

I can't actually see why this works, but it does: tests pass
after this that failed before.
2014-03-20 13:11:00 +10:30
Seán Hayes
3f7378ef60 Allow PassThroughManager subclasses to accept additional params. 2014-03-07 06:32:34 -05:00
Ryan Senkbeil
617ec2af01 Fix InheritanceManager when the model has a self reference.
Otherwise, we reach max recursion depth.
2014-02-19 15:28:01 -06:00
Carl Meyer
f19755ae81 Merge pull request #105 from patrys/patch-1
Don't try to access __slots__ during copy()
2014-01-25 16:35:09 -08:00
Carl Meyer
febc3d645a Merge pull request #101 from funkybob/issue-34
Attempt to carry over extras(select) values from parent
2014-01-25 16:25:36 -08:00
funkybob
a5fe3de330 Deal with Django <1.7 using SortedDict wherein keys() is a generator, not a view 2014-01-21 09:19:54 +11:00
Patryk Zawadzki
80547335c0 Don't try to access __slots__ during copy()
When subclassing Django will copy managers from the ancestor class. Copying in turn calls `copy.copy()` which checks whether the object uses `__slots__` or `__dict__`. This could result in the manager calling `self.get_queryset()` before all models get registered with the ORM.
2014-01-20 12:50:37 +01:00
funkybob
91b07079e0 Use legacy compatible approach 2014-01-14 15:05:03 +11:00
Carl Meyer
6512e3e00e Remove trailing whitespace. 2014-01-10 16:29:59 -07:00
Douglas Meehan
33c600e28c edited class names 2014-01-10 16:18:10 -05:00
Douglas Meehan
9e024a14af removed trailing whitespace 2014-01-10 16:15:42 -05:00
Douglas Meehan
aaf1fc8636 changed class names to be more descriptive 2014-01-10 16:06:08 -05:00
Douglas Meehan
55a15f7e55 Update managers.py 2014-01-09 16:58:51 -05:00
Douglas Meehan
72c8f0bc18 moved get_query_set = get_queryset from the mixin to the manager 2014-01-09 21:47:46 +00:00
Douglas Meehan
c787a98f21 removed GeoDjango specific code. Abstracted all managers 2014-01-08 17:19:00 +00:00
Douglas Meehan
e7c3f6b28e edited doc string 2014-01-08 16:57:59 +00:00
Douglas Meehan
a1ffac9fa7 edited class names 2014-01-08 16:56:32 +00:00
Douglas Meehan
a1abc9bb8a edited class names 2014-01-08 16:54:41 +00:00
Douglas Meehan
b529e576ff added geo support for PassThroughManager 2014-01-08 16:46:39 +00:00
Curtis
6f30e88ba5 Attempt to carry over extras(select) values from parent 2014-01-08 23:46:00 +11:00
Carl Meyer
5e39bcd756 Remove special support for pickling PassThroughManager; apparently unnecessary in all supported Django/Python versions. 2014-01-06 18:18:42 -07:00
Thomas Schreiber
910bcc7830 backwards comptatible get_queryset, for Django < 1.6 2013-12-31 17:30:11 +01:00
Thomas Schreiber
5ae92dba27 fix get_query_set deprecationwarnings 2013-12-30 21:42:52 +01:00
Keryn Knight
a270eef1fd Fixed #59 - manually setting the parent relation
via a OneToOne should present the same behaviour
as the implicit ptr Django generates on
subclasses.

Thanks to Eran Rundstein for reporting the issue
and proposing the fix.
2013-10-26 15:53:15 +01:00
Carl Meyer
06d3b7a5cf Tweak line-continuation indentation. 2013-10-22 12:23:16 -06:00
Keryn Knight
1de58474c0 Implemented #44 - passing Model classes to InheritanceManager's select_subclasses 2013-10-21 21:47:58 +01:00
Travis Swicegood
9111843752 Refactor to make sure get_subclass() is on QuerySet
There's an edge case where you might want to call get_subclass() on a
QuerySet the same way you can call get() after you have already called
various filter/exclude methods.
2013-10-07 18:15:41 -05:00
Carl Meyer
4b6a800050 Fix bug with child/grandchild select_subclasses in Django 1.6+; thanks Keryn Knight. 2013-09-20 10:04:10 -06:00
Andy Freeland
7e381179e4 PassThroughManager calls superclass get_query_set.
As discussed in #31, PassThroughManager and
PassThroughManager.for_queryset_class() would ignore the superclass
version of `get_query_set`.
2013-05-26 16:04:47 -04:00
Alex Orange
1e84465276 Test and fix for second grandchild bug.
Bug is, second grandchild of a given child will get cast to the child
rather then the grandchild.
2013-05-21 14:23:23 -06:00
Trey Hunner
4f2673e6a4 Fix str/unicode problems in Python 3
Changes:
- Use unicode_literals from the future for Python 2.6.5+
- Use six's text_type for proper unicode use in Python 2/3
2013-04-12 14:16:42 -07:00