summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authormatt ferrante <mferrante3@gmail.com>2020-01-06 16:44:32 -0700
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2020-07-09 20:24:00 +0200
commit7d6916e82700896ef23c50720d8cf0de4d6b9074 (patch)
tree02d3af3aa34e4986a602bfd1f3af102b17b6f872 /docs
parent5a3d7cf46205f42303a5f429c388cb507ef5d630 (diff)
Fixed #29789 -- Added support for nested relations to FilteredRelation.
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/models/querysets.txt15
-rw-r--r--docs/releases/3.2.txt3
2 files changed, 7 insertions, 11 deletions
diff --git a/docs/ref/models/querysets.txt b/docs/ref/models/querysets.txt
index 6edc508661..9f541d5414 100644
--- a/docs/ref/models/querysets.txt
+++ b/docs/ref/models/querysets.txt
@@ -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.
diff --git a/docs/releases/3.2.txt b/docs/releases/3.2.txt
index 6c49cf5375..0c877bc1f5 100644
--- a/docs/releases/3.2.txt
+++ b/docs/releases/3.2.txt
@@ -227,6 +227,9 @@ Models
* The :meth:`.QuerySet.update` method now respects the ``order_by()`` clause on
MySQL and MariaDB.
+* :class:`FilteredRelation() <django.db.models.FilteredRelation>` now supports
+ nested relations.
+
Requests and Responses
~~~~~~~~~~~~~~~~~~~~~~