-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update installation.md Add Update indexes.md Update indexes.md Update installation.md Update installation.md Update installation.md
- Loading branch information
1 parent
366b2c8
commit 6c3d98b
Showing
18 changed files
with
62 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Indexes | ||
|
||
If you want to add index to your `TreeModel`, use [`GistIndex`](https://docs.djangoproject.com/en/5.1/ref/contrib/postgres/indexes/#gistindex) from [`postgres`](https://www.postgresql.org/docs/9.1/textsearch-indexes.html). | ||
|
||
```{note} | ||
`GistIndex` was suggested based on [`@pauloxnet`](http://github.com/pauloxnet)'s code sample from this [microsoft Citus Con YouTube video](https://www.youtube.com/watch?v=u8F7bTJVe_4&t=1051s) | ||
``` | ||
|
||
To implement the index in your model: | ||
|
||
```{code-block} python | ||
:caption: models.py | ||
from django.contrib.postgres import indexes as idx | ||
from django_ltree import TreeModel | ||
class CustomTree(TreeModel): | ||
... | ||
class Meta: | ||
indexes = [ | ||
idx.GistIndex(fields=["path"]), | ||
] | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,15 @@ authors = [ | |
"Mario César Señoranis Ayala <[email protected]>", | ||
"Kimsia Sim", | ||
] | ||
maintainers = [ | ||
"baseplate-admin <[email protected]>", | ||
] | ||
license = "MIT" | ||
readme = "README.md" | ||
packages = [{include = "django_ltree"}] | ||
classifiers = [ | ||
packages = [{ include = "django_ltree", from = "src" }] | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Framework :: Django", | ||
"Framework :: Django :: 3.2", | ||
"Framework :: Django :: 4.1", | ||
"Framework :: Django :: 4.2", | ||
"Framework :: Django :: 5.0", | ||
"Framework :: Django :: 5.1", | ||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.