Skip to content
Closure view based Tree models for Django
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
closure_tree Override RunSQL less. Feb 17, 2018
.gitignore Update gitignore Nov 3, 2017
LICENSE Initial commit Oct 20, 2017
README.rst Rename to django-closure-tree Oct 22, 2017


Django closure tree model.

Abstract base model for creating a Closure Tree using a recursive Postgres view.


Inherit from the Node model:

from closure_tree.models import Node

class MyNode(Node):
    name = models.CharField(max_length=30)

Create migrations:

$ ./ makemigrations

Add the CreateTreeClosure migration step:

$ ./ makemigrations --empty myapp
from closure_tree.migrations import CreateTreeClosure

class Migration(migrations.Migration):

    dependencies = [
        ('dummy', '0001_initial'),

    operations = [
You can’t perform that action at this time.