database/schedule_models.py
def export_survey_timings(cls, survey: Survey) -> List[List[int]]:
        """Returns a json formatted list of weekly timings for use on the frontend"""
        # this weird sort order results in correctly ordered output.
        fields_ordered = ("hour", "minute", "day_of_week")
        timings = [[], [], [], [], [], [], []]
        schedule_components = WeeklySchedule.objects. \
            filter(survey=survey).order_by(*fields_ordered).values_list(*fields_ordered)

        # get, calculate, append, dump.
        for hour, minute, day in schedule_components:
            timings[day].append((hour * 60 * 60) + (minute * 60))
        return timings
Returns a json formatted list of weekly timings for use on the frontend
Returns a json formatted list of weekly timings for use on the frontend
Returns a json formatted list of weekly timings for use on the frontend
def export_survey_timings(cls, survey: Survey) -> List[List[int]]:
        fields_ordered = ("hour", "minute", "day_of_week")
        timings = [[], [], [], [], [], [], []]
        schedule_components = WeeklySchedule.objects. \
            filter(survey=survey).order_by(*fields_ordered).values_list(*fields_ordered)
        for hour, minute, day in schedule_components:
            timings[day].append((hour * 60 * 60) + (minute * 60))
        return timings
def export_survey_timings ( cls , survey : Survey ) -> List [ List [ int ] ] : fields_ordered = ( "hour" , "minute" , "day_of_week" ) timings = [ [ ] , [ ] , [ ] , [ ] , [ ] , [ ] , [ ] ] schedule_components = WeeklySchedule . objects . filter ( survey = survey ) . order_by ( * fields_ordered ) . values_list ( * fields_ordered ) for hour , minute , day in schedule_components : timings [ day ] . append ( ( hour * 60 * 60 ) + ( minute * 60 ) ) return timings
Returns a json formatted list of weekly timings for use on the frontend
Returns a json formatted list of weekly timings for use on the frontend
"""Returns a json formatted list of weekly timings for use on the frontend""" # this weird sort order results in correctly ordered output.
 # get, calculate, append, dump.

cls
survey
Survey