netzkolchose / django-treewidget Goto Github PK
View Code? Open in Web Editor NEWtreewidget for django admin
License: MIT License
treewidget for django admin
License: MIT License
Hey netzkolchose,
can you say something about the state of dark mode support?
it seems you've already, at least, started with this and there are CSS files for dark mode, but somehow it's not getting used.
Would you consider to support this and update your package?
Thx so far, really cool widget, I'm using it in a playground prototype kind of thing with django-treebeard.
Related to #6
Hi there,
Would it be possible to support Django 3.0?
The only issue so far seems to be that django.utils.encoding.python_2_unicode_compatible was dropped. I could be replaced by the same functionality in the six package of python 2 compatibility could be dropped.
TreeForeignKey and TreeManyToManyField doesn't work anymore inside the Django administration.
The field is rendered by values are always empty.
Sometimes, when passing initial value to form, the selected element acts wierd and display the wrong selected element (whereas the internal selected value is right!) and sometimes the widget displays 2 selected item even if only one can be selected.
initial = 14 (wrong display)
should be
<select name="parent" class="form-control custom-select" id="id_parent">
<option value="">---------</option>
<option value="14">collecte de données clients</option>
<option value="15" selected>enregistrement audio</option>
<option value="16">enregistrement video</option>
<option value="4">collecte de données salariés</option>
<option value="6">collecte format numérique</option>
<option value="10">disque partagé</option>
<option value="5">collecte format papier</option>
<option value="1">opération de communication</option>
<option value="2">emailing</option>
<option value="3">newsletter</option>
<option value="11">scoring client</option>
<option value="12">scoring de carte bancaire</option>
<option value="13">scoring de crédit</option>
<option value="7">stockage de données salariés</option>
<option value="9">stockage format numérique</option>
<option value="8">stockage format papier</option>
</select>
And my queries log for rendering this small tree is pretty huge:
Is there a way to improve database hit performances with some prefetch/select_related and where? Does it pass through monkey patching or there is another way to do so?
In order to seek a solution to this problem, I detected an issue with the tree rebuilding in treewidget/fields.py:52
method get_drawable_queryset
where collecting disabled/selected IDs. I don't know where it can be useful but remove it improves significantly the database performances.
Thanks for any enlightenment.
Hello, i am interested in this widget can be implied in the django form and presented in the template ?
Currently the tree update view actions are hardcoded to @login_required
, which might be unwanted in certain cases. This needs some thinking, how to make this customizable from the default permissions system.
An easy straight forward fix might be to clamp the extended tree view permissions to the same (write) permissions as the admin.ModelAdmin
classes. On a first glance this seems to be the right fix, as it keeps those views under write permissions, where they semantically belong to.
A more involved change would be to establish additional permissions for those actions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.