seed
django_spire.knowledge.seeding.seed
parent_collection_seeder = CollectionSeeder(count=1)
module-attribute
child_collection_seeder = ChildCollectionSeeder(count=4)
module-attribute
grandchild_collection_seeder = GrandchildCollectionSeeder(count=3)
module-attribute
entry_seeder = EntrySeeder(count=15)
module-attribute
ChildCollectionSeeder
Bases: Seeder
Source code in django_spire/contrib/seeding/seeder.py
model_class = models.Collection
class-attribute
instance-attribute
fields_seeds = {'id': Seeder.exclude(), 'parent_id': Seeder.model.random_queryset_foreign_key(models.Collection.objects.parentless()), 'name': Seeder.llm(str, 'A name for a child knowledge base collection, e.g. a topic within a department.'), 'description': Seeder.llm(str, 'Short description of what documents this child knowledge base collection holds.')}
class-attribute
instance-attribute
CollectionSeeder
Bases: Seeder
Source code in django_spire/contrib/seeding/seeder.py
model_class = models.Collection
class-attribute
instance-attribute
fields_seeds = {'id': Seeder.exclude(), 'parent_id': Seeder.exclude(), 'name': Seeder.llm(str, 'A name for a knowledge base collection, e.g. a department, team, or topic area.'), 'description': Seeder.llm(str, 'Short description of what documents this knowledge base collection holds.')}
class-attribute
instance-attribute
GrandchildCollectionSeeder
Bases: Seeder
Source code in django_spire/contrib/seeding/seeder.py
model_class = models.Collection
class-attribute
instance-attribute
fields_seeds = {'id': Seeder.exclude(), 'parent_id': Seeder.model.random_queryset_foreign_key(models.Collection.objects.filter(parent__isnull=False)), 'name': Seeder.llm(str, 'A name for a nested knowledge base collection, e.g. a sub-topic within a child.'), 'description': Seeder.llm(str, 'Short description of what documents this nested knowledge base collection holds.')}
class-attribute
instance-attribute
EntrySeeder
Bases: Seeder