Skip to main content
Django Fancytree Widget
----------------------

django-fancytree provides a widget using the fancytree js library to
render a forms.ModelMultipleChoiceField as a tree with selectable and
collapsable nodes.

See included project 'treewidget' as an example. Widget is used in
ModelMultipleChoiceField and allows user to select multiple categories.


Requirements
------------

django, django-mptt, jquery, jquery-ui


Usage
-----

::

from fancytree.widgets import FancyTreeWidget

categories = Category.objects.order_by('tree_id', 'lft')

class CategoryForm(forms.Form):
categories = forms.ModelMultipleChoiceField(
queryset=categories,
widget=FancyTreeWidget(queryset=categories)
)


In this example Category is a model registered with django-mptt.

Widget accepts **queryset** option, which expects pre-ordered queryset by
"tree_id" and "lft".

If you want to adjust tree data creation, you can define 'get_doc' method on
your model. Example:

::

def get_doc(self, values):
doc = {"title": name, "key": self.pk}
if str(self.pk) in values:
doc['select'] = True
doc['expand'] = True
return doc

Metadata

Release files for django-fancytree 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-fancytree 0.4.0
File Size Uploaded Provenance
django-fancytree-0.4.0.tar.gz 359.8 kB Without provenance Details

Release files / django-fancytree-0.4.0.tar.gz

Download URL django-fancytree-0.4.0.tar.gz
Size 359.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0aa38ac345b356aa88c2333e91c71060cce20e919ee0f8865263cd42e6a9948c
BLAKE2b-256 checksum
How to use checksums
a3e479124f19686b29185b7bf53d8aa683ffa2b4832a78d6d644b82772943c8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-fancytree 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page