(self, model_event, content, days_of_week, start_day_of_week,
            total_iterations=REPEAT_INDEFINITELY, extra_options=None, repeat_every=1)
Sets this TimedSchedule to be a simple weekly schedule where you can choose
        the days of the week on which to send.

        :param model_event: An example event from which to pull timing information; should be an instance of
            a subclass of AbstractTimedEvent
        :param content: The content (corehq.messaging.scheduling.models.Content object) to send
        :days_of_week: A list of integers representing the days of the week on which to send, with
            0 being Monday and 6 being Sunday to match python's datetime.weekday() method
        :start_day_of_week: The day of the week which will be considered the first day of the week for
            scheduling purposes
        :param total_iterations: The total number of weeks to send for
        :param repeat_every: A value of 1 means repeat every week; 2 means repeat every other week, etc.
Sets this TimedSchedule to be a simple weekly schedule where you can choose
        the days of the week on which to send.
Sets this TimedSchedule to be a simple weekly schedule where you can choose the days of the week on which to send .
def set_simple_weekly_schedule(self, model_event, content, days_of_week, start_day_of_week,
            total_iterations=REPEAT_INDEFINITELY, extra_options=None, repeat_every=1):
        """
        Sets this TimedSchedule to be a simple weekly schedule where you can choose
        the days of the week on which to send.

        :param model_event: An example event from which to pull timing information; should be an instance of
            a subclass of AbstractTimedEvent
        :param content: The content (corehq.messaging.scheduling.models.Content object) to send
        :days_of_week: A list of integers representing the days of the week on which to send, with
            0 being Monday and 6 being Sunday to match python's datetime.weekday() method
        :start_day_of_week: The day of the week which will be considered the first day of the week for
            scheduling purposes
        :param total_iterations: The total number of weeks to send for
        :param repeat_every: A value of 1 means repeat every week; 2 means repeat every other week, etc.
        """
        self.validate_day_of_week(start_day_of_week)
        self.check_positive_repeat_every(repeat_every)

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

            self.event_type = self.get_event_type_from_model_event(model_event)
            self.start_day_of_week = start_day_of_week
            self.repeat_every = repeat_every * 7
            self.total_iterations = total_iterations
            self.ui_type = Schedule.UI_TYPE_WEEKLY
            self.start_offset = 0
            self.set_extra_scheduling_options(extra_options)
            self.save()

            event_days = []
            for day in days_of_week:
                self.validate_day_of_week(day)
                event_days.append((day - start_day_of_week + 7) % 7)

            order = 1
            for day in sorted(event_days):
                event = self.create_event_from_model_event(model_event)
                event.order = order
                event.day = day

                if order == 1:
                    if content.pk is None:
                        content.save()
                else:
                    # Create copies of the content on subsequent events
                    content.pk = None
                    content.save()

                event.content = content
                event.save()
                order += 1
def set_simple_weekly_schedule ( self , model_event , content , days_of_week , start_day_of_week , total_iterations = REPEAT_INDEFINITELY , extra_options = None , repeat_every = 1 ) : self . validate_day_of_week ( start_day_of_week ) self . check_positive_repeat_every ( repeat_every ) with transaction . atomic ( ) : self . delete_related_events ( ) self . event_type = self . get_event_type_from_model_event ( model_event ) self . start_day_of_week = start_day_of_week self . repeat_every = repeat_every * 7 self . total_iterations = total_iterations self . ui_type = Schedule . UI_TYPE_WEEKLY self . start_offset = 0 self . set_extra_scheduling_options ( extra_options ) self . save ( ) event_days = [ ] for day in days_of_week : self . validate_day_of_week ( day ) event_days . append ( ( day - start_day_of_week + 7 ) % 7 ) order = 1 for day in sorted ( event_days ) : event = self . create_event_from_model_event ( model_event ) event . order = order event . day = day if order == 1 : if content . pk is None : content . save ( ) else : # Create copies of the content on subsequent events content . pk = None content . save ( ) event . content = content event . save ( ) order += 1