Usage¶
It is expected that this API will be embedded into your project’s overall DRF-based API. Simply include this app’s URLs as documented in the Installation instructions, and follow the configuration documentation for DRF. You can generate full documentation for your resulting API either through DRF’s native generation tool or you can use a third-party library such as drf-yasg.
Warning
The same known caveats of django-fiction-outlines also apply here.
- Do NOT attempt to create a new node using the Django-provided construction method. Use dedicated methods such as
add_root
,add_child
, andadd_sibling
instead. - Do NOT attempt to directly edit
path
,step
,depth
,num_child
, etc. Use the provided move method. MP_Node
uses a lot of raw SQL, so always retrieve the node from the db again after tree manipulation before calling it to do anything else.- Object permissions come from django-rules, and the permission logic lies in the view layer. If you want to introduce your own custom logic, you should subclass the provided views in order to reduce the risk of security breaches.
- For the same reason, if you must define a custom manager, you NEED to subclass
treebeard
’s baseMP_Node
manager.