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
File details
Details for the file django-closure-tree-0.2.2.tar.gz
.
File metadata
- Download URL: django-closure-tree-0.2.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da644183a371eeefcb8a52e01353c0899daaf66206ef162505b01683f9a145a0 |
|
MD5 | 3835e730fcbc8c79cd270438bcad9b64 |
|
BLAKE2b-256 | d9587aa3d1592666e733e9096dde4d0ce5157fbfbd618743b131d9139f58f027 |
Provenance
File details
Details for the file django_closure_tree-0.2.2-py2.py3-none-any.whl
.
File metadata
- Download URL: django_closure_tree-0.2.2-py2.py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e26b7ee7ffa4d6dc6d6e583511973ed14a5a8bab83960dcaa0d92d4787b6d93a |
|
MD5 | fdc2a4f9cdb71a7eb8597039dd13f453 |
|
BLAKE2b-256 | 1e429ec5759cf9578e9f6497d4b0811b1c1b37972012f052aa0cef18c8a91f98 |