From c8f5ea84f2d4c8e8090d17a30ecafdb8d4c601d4 Mon Sep 17 00:00:00 2001 From: Matthias Kestenholz Date: Mon, 19 Aug 2024 16:16:10 +0200 Subject: [PATCH] Condense --- README.rst | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index eb132e1..89e31c5 100644 --- a/README.rst +++ b/README.rst @@ -171,18 +171,16 @@ Basic usage nodes = Node.objects.order_siblings_by("id") Note that the tree queryset doesn't support all types of queries Django -supports. For example, updating all descendants directly isn't supported: +supports. For example, updating all descendants directly isn't supported. The +reason for that is that the recursive CTE isn't added to the UPDATE query +correctly. Workarounds often include moving the tree query into a subquery: .. code-block:: python - # Doesn't work + # Doesn't work: node.descendants().update(is_active=False) -The reason for that is that the recursive CTE isn't added to the UPDATE query -correctly. Workarounds often include moving the tree query into a subquery: - -.. code-block:: python - + # Use this workaround instead: Node.objects.filter(pk__in=node.descendants()).update(is_active=False)