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
Built Distribution
Close
Hashes for django-closure-tree-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6250653a7463e953a12e07a0937edb641b190da7d8028b9bba436d6e2d6736a1 |
|
MD5 | df626dc7943ec78fed9e713d970f3704 |
|
BLAKE2b-256 | 5d775d129a55b4b77144105b32270eecfe7714332eace8c325a8c90b6f76a377 |
Close
Hashes for django_closure_tree-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1605a371feb8b280f2e899034fa800c904b374888a721631d0c6438d478d8547 |
|
MD5 | e190cad2e6e6a43bb1e398a527950f90 |
|
BLAKE2b-256 | f3c3a4a615635554c95d5e91d56a55022e64497dc402e747ac9d70cf3620b0d4 |