Skip to content

breaking changes#38

Open
amirreza-sf80 wants to merge 37 commits intomariocesar:masterfrom
amirreza-sf80:main
Open

breaking changes#38
amirreza-sf80 wants to merge 37 commits intomariocesar:masterfrom
amirreza-sf80:main

Conversation

@amirreza-sf80
Copy link
Copy Markdown
Contributor

@amirreza-sf80 amirreza-sf80 commented Dec 21, 2025

what i've done so far:

  1. by default, use id to create path ehile allowing customization
  2. added btree and gist indexes by default (can be overridden)
  3. rename manager objects to t_object to avoid confilicting with other packages
  4. TreeManager.create now creates objects without parents (root items)
  5. added Subpath and NLevel database functions
  6. path is now autogenerated
  7. drop django 4.2
  8. drop python 3.10
  9. move all configs to pyproject
  10. use uv in the CI (you don't have to use it locally, tho i recommend it)
  11. added some dev tools to make work easier (harlequin for database, django-cmd for python paths, ipython for shell, prek for pre-commit)
  12. some type hinting
  13. these methods have been added to TreeModel:
    1. delete
    2. delete_cascade
    3. make_root
    4. change_parent
    5. get_root
  14. these methods have been optimized a bit:
    1. children
    2. siblings
    3. add_child
  15. moved validator to validators.py file
  16. moved form field to forms.py file

@amirreza-sf80
Copy link
Copy Markdown
Contributor Author

i'll also edit the README file to show changes

let me know if there's a problem with these changes

@amirreza-sf80 amirreza-sf80 force-pushed the main branch 3 times, most recently from e2e0ea4 to 27f0216 Compare December 24, 2025 15:38
@amirreza-sf80 amirreza-sf80 force-pushed the main branch 2 times, most recently from 3a1534d to 428eb22 Compare December 24, 2025 15:41
@amirreza-sf80
Copy link
Copy Markdown
Contributor Author

@mariocesar 👋
updated the readme file as well
let me know if it's lacking anything

@mariocesar
Copy link
Copy Markdown
Owner

@amirreza8002 sorrry for the late reply.

My main concern is that these could break the user use, there are examples where the path is not unique or based in PKs. The first example is https://www.postgresql.org/docs/current/ltree.html#LTREE-EXAMPLE the official example for ltree.

I feel I was mistaken when I initially implement using django-treebeard as a reference.

I like your proposal, I want to merge it, but will like to also include a way for users to implement as they need and not constraint to pk as I started doing.

I'll have more time this week and help you

allow changing the field that is used in generating the path
@amirreza-sf80
Copy link
Copy Markdown
Contributor Author

amirreza-sf80 commented Feb 27, 2026

hi @mariocesar 👋
i made some changes that will allow people to configure which field should be used for generating paths
tho as i mentioned in the readme using unique values is my recommendation

also added a guide on how to customize the manager when using a non-autogenerated field for path, i thought about handling it out of the box, but i'm not sure how to check if a field is auto-generated, and if it's even worth it

let me know what you think

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants