Skip to content

Commit

Permalink
Amend the CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Apr 25, 2024
1 parent 24639fc commit d292397
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ Change log
Next version
~~~~~~~~~~~~

- Reimplemented the rank table construction using a real queryset; this enables
support for pre-filtering the tree queryset using ``.tree_filter()`` and
``.tree_exclude()``. Thanks rhomboss!
- Added a ``.tree_fields()`` method to allow adding additional columns to the
tree queryset, allowing collecting ancestors fields directly when running the
initial query. For example, ``.tree_fields(tree_names="name")`` will collect
all ``name`` fields in a ``tree_fields`` array on the model instances. For
now the code only supports string fields and integer fields. Also,
MySQL/MariaDB aren't supported yet.


0.18 (2024-04-03)
~~~~~~~~~~~~~~~~~
Expand Down
6 changes: 6 additions & 0 deletions tests/testapp/test_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,3 +943,9 @@ def test_tree_fields(self):
["root", "2", "2-2"],
],
)

# ids = [obj.tree_pks for obj in Model.objects.tree_fields(tree_pks="custom_id")]
# self.assertIsInstance(ids[0][0], int)

# ids = [obj.tree_pks for obj in Model.objects.tree_fields(tree_pks="parent_id")]
# self.assertEqual(ids[0], [""])

0 comments on commit d292397

Please sign in to comment.