Skip to content

Commit a6c5c9a

Browse files
Better docs
Update installation.rst
1 parent c9421c7 commit a6c5c9a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

django_ltree/managers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@
99

1010

1111
class TreeManager(models.Manager):
12-
def get_queryset(self):
12+
def get_queryset(self) -> TreeQuerySet["TreeModel"]:
1313
"""Returns a queryset with the models ordered by `path`"""
1414
return TreeQuerySet(model=self.model, using=self._db).order_by("path")
1515

16-
def roots(self) -> models.QuerySet["TreeModel"]:
16+
def roots(self) -> TreeQuerySet["TreeModel"]:
1717
"""Returns the roots of a given model"""
1818
return self.filter().roots()
1919

20-
def children(self, path: str) -> models.QuerySet["TreeModel"]:
20+
def children(self, path: str) -> TreeQuerySet["TreeModel"]:
2121
"""Returns the childrens of a given object"""
2222
return self.filter().children(path)
2323

2424
def create_child(
2525
self, parent: "TreeModel" = None, **kwargs
26-
) -> models.QuerySet["TreeModel"]:
26+
) -> TreeQuerySet["TreeModel"]:
2727
"""Creates a tree child with or without parent"""
2828
paths_in_use = parent.children() if parent else self.roots()
2929
prefix = parent.path if parent else None

docs/installation.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Installation
2222

2323
.. code-block:: python
2424
25+
# settings.py
2526
INSTALLED_APPS = [
2627
...,
2728
"django_ltree",
@@ -31,5 +32,5 @@ Installation
3132
3. Run migrations:
3233

3334
.. code-block:: sh
34-
35+
3536
./manage.py migrate

0 commit comments

Comments
 (0)