mirror of
https://github.com/django/django.git
synced 2025-08-04 10:59:45 +00:00
Fixed #29789 -- Added support for nested relations to FilteredRelation.
This commit is contained in:
parent
5a3d7cf462
commit
7d6916e827
5 changed files with 336 additions and 39 deletions
|
@ -3707,17 +3707,10 @@ operate on vegetarian pizzas.
|
|||
|
||||
``FilteredRelation`` doesn't support:
|
||||
|
||||
* Conditions that span relational fields. For example::
|
||||
|
||||
>>> Restaurant.objects.annotate(
|
||||
... pizzas_with_toppings_startswith_n=FilteredRelation(
|
||||
... 'pizzas__toppings',
|
||||
... condition=Q(pizzas__toppings__name__startswith='n'),
|
||||
... ),
|
||||
... )
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
ValueError: FilteredRelation's condition doesn't support nested relations (got 'pizzas__toppings__name__startswith').
|
||||
* :meth:`.QuerySet.only` and :meth:`~.QuerySet.prefetch_related`.
|
||||
* A :class:`~django.contrib.contenttypes.fields.GenericForeignKey`
|
||||
inherited from a parent model.
|
||||
|
||||
.. versionchanged:: 3.2
|
||||
|
||||
Support for nested relations was added.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue