| Age | Commit message (Collapse) | Author |
|
This avoids two isinstance() calls per UUID value.
|
|
indirect ancestors.
When looking for cached values in ManyRelatedManager and
ForwardManyToOneDescriptor walk up the whole chain of ancestors
(as long as they are cached) to find the prefetched relation.
|
|
queryset.
Regression in 626d77e52a3f247358514bcf51c761283968099c.
Refs #36116.
Thanks Cornelis Poppema for the excellent report.
|
|
representations.
Ensured that rel_obj_attr and instance_attr return matching (pk, cls) tuples
in GenericForeignKey.get_prefetch_queryset(), preventing mismatches when
prefetching related objects where pk and get_prep_value() differ. Using
value_to_string() also makes this code compatible with composite primary keys.
|
|
The original queryset._next_is_sticky() call never had the intended effect as
no further filtering was applied internally after the pk__in lookup making it
a noop.
In order to be coherent with how related filters are applied when retrieving
objects from a related manager the effects of what calling _next_is_sticky()
prior to applying annotations and filters to the queryset provided for
prefetching are emulated by allowing the reuse of all pre-existing JOINs.
Thanks David Glenck and Thiago Bellini Ribeiro for the detailed reports and
tests.
|
|
|
|
Follow up to 6461583b6cc257d25880ef9a9fd7e2125ac53ce1.
|
|
|
|
related field is UUIDField.
|
|
|
|
Regression in 514b2c989a948e3c59bda0da0c9427acf643cf5b.
|
|
OneToOneField primary key to a non-pk field.
|
|
|
|
Regression in 7ec330eeb96d0874949eacb8ed1bbb97e11807e1.
Thanks Tim Graham for the review.
|
|
|
|
|
|
Thanks Trac alias karyon for the report and Tim for the review.
|
|
ForeignKey/OneToOneField
|
|
This resolves a problem on databases besides PostgreSQL when using
prefetch_related with a source model that uses a UUID primary key.
|
|
|
|
|
|
Regression from f51c1f59 when using select_related then prefetch_related
on the reverse side of an O2O:
Author.objects.select_related('bio').prefetch_related('bio__books')
Thanks Aymeric Augustin for the report and tests. Refs #17001.
|
|
GenericRelation now supports an optional related_query_name argument.
Setting related_query_name adds a relation from the related object back to
the content type for filtering, ordering and other query operations.
Thanks to Loic Bistuer for spotting a couple of important issues in
his review.
|
|
The original patch for custom prefetches didn't allow usage of custom
queryset for single valued relations (along ForeignKey or OneToOneKey).
Allowing these enables calling performance oriented queryset methods like
select_related or defer/only.
Thanks @akaariai and @timgraham for the reviews. Refs #17001.
|
|
It contained models, forms and admin objects causing undesirable
import side effects. Refs #16368.
Thanks to Ramiro, Carl and Loïc for the review.
|
|
Regression introduced by commit 9777442.
Thanks to trac username troygrosfield for the report and test case.
|
|
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.
|
|
Signed-off-by: Jason Myers <jason@jasonamyers.com>
|
|
|
|
|
|
Thanks to av@rdf.ru and flarno11@yahoo.de for the report.
|
|
return a QuerySet.
|
|
|