Built-in tree view for Django-admin sites?

Why is there no built-in tree view in the Python Django framework? Isn’t there a simple way to visualize a model when a class has a 1: n relationship to itself?

I know of some fancy Google code projects to achieve this, but I think there should be some common sense in the Django community to handle this general case. Any ideas?

+3
source share
3 answers

The main developers are quite strongly against adding additional materials to Django if there is no clear universal requirement, especially if there are excellent third-party projects that provide this functionality.

This is absolutely true for tree views. This is very far from what everyone wants to do, and there are at least three projects that provide trees, including appropriate tools for creating tree views in views and the administrator.

I suggest you look into them - my favorite django-mptt .

+2
source

Django - django-admirarchy. (, Norton Commander Co).

+1

check:

tree structure of parent relationship of child elements in django templates

http://code.google.com/p/django-treeview/

An alternative would be to implement your tree in JavaScript. Django and JavaScript play well, so they can work just fine. There are many javascript trees, just ask google

0
source

Source: https://habr.com/ru/post/1718213/


All Articles