Commit Graph

20 Commits

Author SHA1 Message Date
Andriy Sokolovskiy 2913d6b77d Fixed #24831 -- Fixed pickling queryset with prefetch_related() after deleting objects. 2015-06-02 09:54:53 -04:00
Tim Graham 0f941f57ba Fixed mistakes in tests unveiled by version bump to 1.8.1.
Forwardport of e7366ab1f9 from stable/1.8.x
2015-04-02 08:14:08 -04:00
Anssi Kääriäinen 8f30556329 Renamed Field.rel attribute to remote_field
Field.rel is now deprecated. Rel objects have now also remote_field
attribute. This means that self == self.remote_field.remote_field.

In addition, made the Rel objects a bit more like Field objects. Still,
marked ManyToManyFields as null=True.
2015-03-25 08:16:12 -04:00
Anssi Kääriäinen f95122e541 Fixed #24381 -- removed ForeignObjectRel opts and to_opts
These cached properies were causing problems with pickling, and in
addition they were confusingly defined: field.rel.model._meta was
not the same as field.rel.opts.

Instead users should use field.rel.related_model._meta inplace of
field.rel.opts, and field.rel.to._meta in place of field.rel.to_opts.
2015-02-23 07:24:43 -05:00
Tim Graham 0ed7d15563 Sorted imports with isort; refs #23860. 2015-02-06 08:16:28 -05:00
Loic Bistuer 4c3bfe9053 Fixed #24211 -- Removed ValuesQuerySet() and ValuesListQuerySet().
Thanks Anssi Kääriäinen, Marc Tamlyn, and Tim Graham for the reviews.
2015-01-30 22:02:58 +07:00
Daniel Pyrathon fb48eb0581 Fixed #12663 -- Formalized the Model._meta API for retrieving fields.
Thanks to Russell Keith-Magee for mentoring this Google Summer of
Code 2014 project and everyone else who helped with the patch!
2015-01-06 19:25:12 -05:00
Claude Paroz fae551d765 Complemented pickle test for ValuesQuerySet with related field
Refs #14515.
2014-12-24 14:58:32 +01:00
Anubhav Joshi 42736ac8e8 Fixed #21430 -- Added a RuntimeWarning when unpickling Models and QuerySets from a different Django version.
Thanks FunkyBob for the suggestion, prasoon2211 for the initial patch,
and akaariai, loic, and charettes for helping in shaping the patch.
2014-06-11 10:03:34 -04:00
Loic Bistuer 3e4dc5ecf2 Fixed #21853 -- Fixed Manager.__module__ to properly return 'django.db.models.manager'.
The combination of BaseManager.from_queryset() and RenameMethodsBase results in
Manager.__module__ having the wrong value. This can be an issue when trying to
pickle the Manager class.
2014-01-28 08:17:01 -05:00
coagulant 8eec2d93b6 Fixed all E261 warnings 2013-11-02 23:50:33 -05:00
Jason Myers c3791463a5 Fixing E302 Errors
Signed-off-by: Jason Myers <jason@jasonamyers.com>
2013-11-02 23:48:47 -05:00
Tim Graham 36ded01527 Fixed #21302 -- Fixed unused imports and import *. 2013-11-02 15:24:56 -04:00
Alex Gaynor 9d740eb8b1 Fix all violators of E231 2013-10-26 12:15:03 -07:00
Anssi Kääriäinen 74b91b3888 Added tests for double-pickling a QuerySet
Refs #21102.
2013-09-14 10:33:15 +03:00
Claude Paroz 5c1143910e Removed most of absolute_import imports
Should be unneeded with Python 2.7 and up.
Added some unicode_literals along the way.
2013-07-29 20:28:13 +02:00
Loic Bistuer 31fadc1202 Fixed #20625 -- Chainable Manager/QuerySet methods.
Additionally this patch solves the orthogonal problem that specialized
`QuerySet` like `ValuesQuerySet` didn't inherit from the current `QuerySet`
type. This wasn't an issue until now because we didn't officially support
custom `QuerySet` but it became necessary with the introduction of this new
feature.

Thanks aaugustin, akaariai, carljm, charettes, mjtamlyn, shaib and timgraham
for the reviews.
2013-07-26 12:41:27 +03:00
Anssi Kääriäinen 5459795ef2 Fixed #20289 -- pickling of dynamic models 2013-06-14 17:05:54 +03:00
Baptiste Mispelon a40746b1cb Fix #20158: invalid code in queryset_pickle test models. 2013-03-29 13:32:21 +01:00
Florian Apolloner 89f40e3624 Merged regressiontests and modeltests into the test root. 2013-02-26 14:36:57 +01:00