database/schedule_models.py
def create_absolute_schedules(timings: List[List[int]], survey: Survey) -> bool:
        """ Creates new AbsoluteSchedule objects from a frontend-style list of dates and times"""
        survey.absolute_schedules.all().delete()

        if survey.deleted or not timings:
            return False

        duplicated = False
        for year, month, day, num_seconds in timings:
            _, created = AbsoluteSchedule.objects.get_or_create(
                survey=survey,
                date=date(year=year, month=month, day=day),
                hour=num_seconds // 3600,
                minute=num_seconds % 3600 // 60
            )
            if not created:
                duplicated = True

        return duplicated
 Creates new AbsoluteSchedule objects from a frontend-style list of dates and times
Creates new AbsoluteSchedule objects from a frontend-style list of dates and times
Creates new AbsoluteSchedule objects from a frontend - style list of dates and times
def create_absolute_schedules(timings: List[List[int]], survey: Survey) -> bool:
        survey.absolute_schedules.all().delete()
        if survey.deleted or not timings:
            return False
        duplicated = False
        for year, month, day, num_seconds in timings:
            _, created = AbsoluteSchedule.objects.get_or_create(
                survey=survey,
                date=date(year=year, month=month, day=day),
                hour=num_seconds // 3600,
                minute=num_seconds % 3600 // 60
            )
            if not created:
                duplicated = True
        return duplicated
def create_absolute_schedules ( timings : List [ List [ int ] ] , survey : Survey ) -> bool : survey . absolute_schedules . all ( ) . delete ( ) if survey . deleted or not timings : return False duplicated = False for year , month , day , num_seconds in timings : _ , created = AbsoluteSchedule . objects . get_or_create ( survey = survey , date = date ( year = year , month = month , day = day ) , hour = num_seconds // 3600 , minute = num_seconds % 3600 // 60 ) if not created : duplicated = True return duplicated
Creates new AbsoluteSchedule objects from a frontend-style list of dates and times
Creates new AbsoluteSchedule objects from a frontend - style list of dates and times
""" Creates new AbsoluteSchedule objects from a frontend-style list of dates and times"""
timings
List[List[int]]
survey
Survey