Skip to content

seeder

django_spire.metric.visual.presentation.seeding.seeder

SLIDE_COUNT = 3 module-attribute

PresentationSeeder

Bases: Seeder

Source code in django_spire/contrib/seeding/seeder.py
def __init__(self, count: int = 1, verbose: bool = True) -> None:
    self.seeds: list[Seed] = []
    self._model_object_ids: list[int | str] = []
    self._count: int = count
    self.verbose: bool = verbose

cache_enabled = False class-attribute instance-attribute

model_class = models.Presentation class-attribute instance-attribute

fields_seeds = {'id': Seeder.exclude(), 'name': Seeder.ordered.choice([seed['name'] for seed in PRESENTATION_SEEDS], wrap=True), 'description': Seeder.ordered.choice([seed['description'] for seed in PRESENTATION_SEEDS], wrap=True), 'is_active': Seeder.static(True), 'is_deleted': Seeder.static(False)} class-attribute instance-attribute

__post_seed_database__

Source code in django_spire/metric/visual/presentation/seeding/seeder.py
def __post_seed_database__(self) -> None:
    for index, presentation in enumerate(self.queryset.order_by('pk')):
        self._seed_slides(presentation, index)