(self, event_and_content_objects, total_iterations=REPEAT_INDEFINITELY,
            start_offset=0, start_day_of_week=ANY_DAY, extra_options=None, repeat_every=1)
:param event_and_content_objects: A list of (event, content) tuples where event is
        an instance of a subclass of AbstractTimedEvent and content is an instance of a
        subclass of Content. These tuples should already be in the right order, and the
        order attribute of each event will be set according to the order in this list.
        It's also expected that each event is of the same type (i.e., TimedEvent, RandomTimedEvent,
        or CasePropertyTimedEvent) for the purposes of displaying this schedule in the UI.

        :param total_iterations: the total iterations of the schedule to perform

        :param start_offset: the start offset

        :param start_day_of_week: the start day of the week

        :param extra_options: any extra options that will be passed to set_extra_scheduling_options

        :param repeat_every: this should be the number of days in the schedule and will
        dictate how often the schedule repeats
:param event_and_content_objects: A list of (event, content) tuples where event is
        an instance of a subclass of AbstractTimedEvent and content is an instance of a
        subclass of Content. These tuples should already be in the right order, and the
        order attribute of each event will be set according to the order in this list.
        It's also expected that each event is of the same type (i.e., TimedEvent, RandomTimedEvent,
        or CasePropertyTimedEvent) for the purposes of displaying this schedule in the UI.
: param event_and_content_objects : A list of ( event content ) tuples where event is an instance of a subclass of AbstractTimedEvent and content is an instance of a subclass of Content . These tuples should already be in the right order and the order attribute of each event will be set according to the order in this list . It s also expected that each event is of the same type ( i . e . TimedEvent RandomTimedEvent or CasePropertyTimedEvent ) for the purposes of displaying this schedule in the UI .
def set_custom_daily_schedule(self, event_and_content_objects, total_iterations=REPEAT_INDEFINITELY,
            start_offset=0, start_day_of_week=ANY_DAY, extra_options=None, repeat_every=1):
        """
        :param event_and_content_objects: A list of (event, content) tuples where event is
        an instance of a subclass of AbstractTimedEvent and content is an instance of a
        subclass of Content. These tuples should already be in the right order, and the
        order attribute of each event will be set according to the order in this list.
        It's also expected that each event is of the same type (i.e., TimedEvent, RandomTimedEvent,
        or CasePropertyTimedEvent) for the purposes of displaying this schedule in the UI.

        :param total_iterations: the total iterations of the schedule to perform

        :param start_offset: the start offset

        :param start_day_of_week: the start day of the week

        :param extra_options: any extra options that will be passed to set_extra_scheduling_options

        :param repeat_every: this should be the number of days in the schedule and will
        dictate how often the schedule repeats
        """

        self.check_positive_repeat_every(repeat_every)

        if len(event_and_content_objects) == 0:
            raise ValueError("Expected at least one (event, content) tuple")

        if repeat_every <= max([e[0].day for e in event_and_content_objects]):
            raise ValueError("repeat_every must be large enough to cover all days in the schedule")

        with transaction.atomic():
            self.delete_related_events()

            self.ui_type = self.UI_TYPE_CUSTOM_DAILY
            self.event_type = self.get_event_type_from_model_event(event_and_content_objects[0][0])
            self.start_offset = start_offset
            self.start_day_of_week = start_day_of_week
            self.repeat_every = repeat_every
            self.total_iterations = total_iterations
            self.set_extra_scheduling_options(extra_options)
            self.save()

            # passing `start` just controls where order starts counting at, it doesn't
            # cause elements to be skipped
            for order, event_and_content in enumerate(event_and_content_objects, start=1):
                event, content = event_and_content

                if not isinstance(event, AbstractTimedEvent):
                    raise TypeError("Expected AbstractTimedEvent")

                if not isinstance(content, Content):
                    raise TypeError("Expected Content")

                content.save()
                event.schedule = self
                event.content = content
                event.order = order
                event.save()
def set_custom_daily_schedule ( self , event_and_content_objects , total_iterations = REPEAT_INDEFINITELY , start_offset = 0 , start_day_of_week = ANY_DAY , extra_options = None , repeat_every = 1 ) : self . check_positive_repeat_every ( repeat_every ) if len ( event_and_content_objects ) == 0 : raise ValueError ( "Expected at least one (event, content) tuple" ) if repeat_every <= max ( [ e [ 0 ] . day for e in event_and_content_objects ] ) : raise ValueError ( "repeat_every must be large enough to cover all days in the schedule" ) with transaction . atomic ( ) : self . delete_related_events ( ) self . ui_type = self . UI_TYPE_CUSTOM_DAILY self . event_type = self . get_event_type_from_model_event ( event_and_content_objects [ 0 ] [ 0 ] ) self . start_offset = start_offset self . start_day_of_week = start_day_of_week self . repeat_every = repeat_every self . total_iterations = total_iterations self . set_extra_scheduling_options ( extra_options ) self . save ( ) # passing `start` just controls where order starts counting at, it doesn't # cause elements to be skipped for order , event_and_content in enumerate ( event_and_content_objects , start = 1 ) : event , content = event_and_content if not isinstance ( event , AbstractTimedEvent ) : raise TypeError ( "Expected AbstractTimedEvent" ) if not isinstance ( content , Content ) : raise TypeError ( "Expected Content" ) content . save ( ) event . schedule = self event . content = content event . order = order event . save ( )