Skip to content

ordered_helper

django_spire.contrib.seeding.field.seed.helper.ordered_helper

OrderedFieldSeedHelper

Bases: FieldSeedHelper

Source code in django_spire/contrib/seeding/field/seed/helper/helper.py
def __init__(self, locale: str | list[str] = 'en_CA') -> None:
    self.locale = locale

choice staticmethod

Source code in django_spire/contrib/seeding/field/seed/helper/ordered_helper.py
@staticmethod
def choice(sequence: Sequence, wrap: bool = False) -> OrderedSequenceFieldSeed:
    return OrderedSequenceFieldSeed(sequence=sequence, wrap=wrap)

datetime staticmethod

Source code in django_spire/contrib/seeding/field/seed/helper/ordered_helper.py
@staticmethod
def datetime(start: datetime, step: timedelta) -> DateStepFieldSeed:
    if timezone.is_naive(start):
        start = timezone.make_aware(start)

    return DateStepFieldSeed(start=start, step=step)