django-ltree
django-ltree copied to clipboard
more documentation on how to use this library better?
I have this exact code snippet and the migration is successful.
from core.models import PersonStampedModel
from django_ltree.fields import PathField
from model_utils.models import SoftDeletableModel, TimeStampedModel
from organizations.managers import OrganizationOwnedSoftDeletableManager
from organizations.models import OrganizationOwnedModel
from partial_index import PQ, PartialIndex
class WorkBreakdownStructure(
TimeStampedModel, SoftDeletableModel, PersonStampedModel, OrganizationOwnedModel
):
wbs_number = PathField(primary_key=True, editable=True)
objects = OrganizationOwnedSoftDeletableManager()
unique_field_in_organization = "wbs_number"
def __str__(self):
return str(self.wbs_number)
class Meta:
indexes = [
PartialIndex(
fields=["wbs_number", "organization"], unique=True, where=PQ(is_removed=False)
)
]
I wanted to quickly bulk create the following records:
ABC20.12345.50000 - ABC20.12345.51000
I was wondering if there's some documentation on how to do this.
versions
Django: v2.2.9 Python: v3.6 postgres: v10
It would be great to see at least any kind of example usind it.
I certainly neglect the documentation, could you give me a list of missing points? what do you think needs to be addressed?
If it's possible, could you provide an example for the model and usage information please? For example, how to import your library in the right way, how to make a model, how to get and set data. As for me, I'm making first steps learning django/python, so it's a bit difficult. Thank you!