django1/django/db/models
Loic Bistuer f51c1f5900 Fixed #17001 -- Custom querysets for prefetch_related.
This patch introduces the Prefetch object which allows customizing prefetch
operations.

This enables things like filtering prefetched relations, calling select_related
from a prefetched relation, or prefetching the same relation multiple times
with different querysets.

When a Prefetch instance specifies a to_attr argument, the result is stored
in a list rather than a QuerySet. This has the fortunate consequence of being
significantly faster. The preformance improvement is due to the fact that we
save the costly creation of a QuerySet instance.

Thanks @akaariai for the original patch and @bmispelon and @timgraham
for the reviews.
2013-11-07 14:49:49 +02:00
..
fields Fixed #17001 -- Custom querysets for prefetch_related. 2013-11-07 14:49:49 +02:00
sql Fixed #20600 -- ordered distinct(*fields) in subqueries 2013-11-07 14:29:50 +02:00
__init__.py Fixed #17001 -- Custom querysets for prefetch_related. 2013-11-07 14:49:49 +02:00
aggregates.py Fixed #21302 -- Fixed unused imports and import *. 2013-11-02 15:24:56 -04:00
base.py Fixed all E261 warnings 2013-11-02 18:20:39 -04:00
constants.py Refactored qs.add_q() and utils/tree.py 2013-03-13 10:44:49 +02:00
deletion.py Made MigrationWriter look for a "deconstruct" attribute on functions. 2013-09-10 10:12:23 -04:00
expressions.py Fixed #17027 -- Added support for the power operator in F expressions. 2013-10-22 10:29:57 -04:00
loading.py Fixed flake8 E251 violations 2013-11-03 03:22:11 -06:00
manager.py Fixed #13724: Corrected routing of write queries involving managers. 2013-09-30 13:05:43 +08:00
options.py More attacking E302 violators 2013-11-02 13:12:09 -07:00
query.py Fixed #17001 -- Custom querysets for prefetch_related. 2013-11-07 14:49:49 +02:00
query_utils.py Fixed #17627 -- Renamed util.py files to utils.py 2013-09-16 12:52:05 -04:00
related.py A large number of stylistic cleanups across django/db/ 2013-07-08 10:39:54 +10:00
signals.py Fixed #20943 -- Weakly reference senders when caching their associated receivers 2013-08-21 22:30:45 +01:00