A Closure based Tree model for Django.
Project description
Django closure tree model.
Abstract base model for creating a Closure Tree using a recursive Postgres view.
http://schinckel.net/2016/01/27/django-trees-via-closure-view/
Usage
Inherit from the Node model:
from closure_tree.models import Node
class MyNode(Node):
name = models.CharField(max_length=30)
Create migrations:
$ ./manage.py makemigrations
Add the CreateTreeClosure migration step:
$ ./manage.py makemigrations --empty myapp
from closure_tree.migrations import CreateTreeClosure
class Migration(migrations.Migration):
dependencies = [
('dummy', '0001_initial'),
]
operations = [
CreateTreeClosure('MyNode'),
]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-closure-tree-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0081eb9210bbeac9177a9a72078b2ed59b7e80a3cfb7780ecddb6b154e761d4 |
|
MD5 | c0858c605d16db58a1e03b8f727b99b3 |
|
BLAKE2b-256 | d8e4fe7d3eb9b2e05492f2b2a98e418fa672dc2d69c63908d4df468da2f9db3d |