closure-tree-0.1.0
توضیحات
A Closure based Tree model for Django.
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | closure-tree-0.1.0 |
| نام | closure-tree |
| نسخه کتابخانه | 0.1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Curtis Maloney |
| ایمیل نویسنده | curtis@tinbrain.net |
| آدرس صفحه اصلی | https://github.com/funkybob/closure_tree |
| آدرس اینترنتی | https://pypi.org/project/closure-tree/ |
| مجوز | MIT |
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:
.. code-block:: python
from closure_tree.models import Node
class MyNode(Node):
name = models.CharField(max_length=30)
Create migrations:
.. code-block:: sh
$ ./manage.py makemigrations
Add the CreateTreeClosure migration step:
.. code-block:: sh
$ ./manage.py makenigrations --empty myapp
.. code-block:: python
from closure_tree.migrations import CreateTreeClosure
class Migration(migrations.Migration):
dependencies = [
('dummy', '0001_initial'),
]
operations = [
CreateTreeClosure('MyNode'),
]
نیازمندی
| مقدار | نام |
|---|---|
| - | django |
نحوه نصب
نصب پکیج whl closure-tree-0.1.0:
pip install closure-tree-0.1.0.whl
نصب پکیج tar.gz closure-tree-0.1.0:
pip install closure-tree-0.1.0.tar.gz