Skip to content

Commit

Permalink
Condense
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Aug 19, 2024
1 parent 23fd3c5 commit c8f5ea8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c8f5ea8

Please sign in to comment.