django1/django/db
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
..
backends Fixed all E261 warnings 2013-11-02 18:20:39 -04:00
migrations flake8 fixes 2013-11-06 20:00:48 -08:00
models Fixed #17001 -- Custom querysets for prefetch_related. 2013-11-07 14:49:49 +02:00
__init__.py A large number of stylistic cleanups across django/db/ 2013-07-08 10:39:54 +10:00
transaction.py Fixed #21288 -- Fixed E126 pep8 warnings 2013-10-21 08:31:30 -04:00
utils.py Fixed #21302 -- Fixed unused imports and import *. 2013-11-02 15:24:56 -04:00