Skip to content

seeder

django_spire.metric.visual.signage.seeding.seeder

SignageSeeder

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.Signage class-attribute instance-attribute

fields_seeds = {'id': Seeder.exclude(), 'key': Seeder.ordered.choice([seed['key'] for seed in SIGNAGE_SEEDS], wrap=True), 'name': Seeder.ordered.choice([seed['name'] for seed in SIGNAGE_SEEDS], wrap=True), 'title': Seeder.ordered.choice([seed['title'] for seed in SIGNAGE_SEEDS], wrap=True), 'description': Seeder.ordered.choice([seed['description'] for seed in SIGNAGE_SEEDS], wrap=True), 'slide_display_seconds': Seeder.ordered.choice([seed['slide_display_seconds'] for seed in SIGNAGE_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/signage/seeding/seeder.py
def __post_seed_database__(self) -> None:
    for signage in self.queryset:
        self._seed_links(signage)