summaryrefslogtreecommitdiff
path: root/tests/cache
diff options
context:
space:
mode:
authorLoic Bistuer <loic.bistuer@sixmedia.com>2013-11-07 00:25:05 +0700
committerAnssi Kääriäinen <akaariai@gmail.com>2013-11-07 14:49:49 +0200
commitf51c1f590085556abca44fd2a49618162203b2ec (patch)
tree4577d32e1e99bb7f1032ee394a80692e552846e5 /tests/cache
parentb1b04df06522b092a9b4768d2d61c52956e00eca (diff)
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.
Diffstat (limited to 'tests/cache')
0 files changed, 0 insertions, 0 deletions