(self, new_schedule)
Set the schedule as head of the schedule.
        Does not save the case document.
Set the schedule as head of the schedule.
        Does not save the case document.
Set the schedule as head of the schedule . Does not save the case document .
def set_schedule(self, new_schedule):
        """
        Set the schedule as head of the schedule.
        Does not save the case document.
        """
        assert isinstance(new_schedule, CDotWeeklySchedule), \
            "setting schedule instance must be a CDotWeeklySchedule class"
        # first, set all the others to inactive
        schedules = self.get_schedules()
        new_schedule.deprecated = False
        if new_schedule.started is None or new_schedule.started <= datetime.utcnow():
            new_schedule.started = datetime.utcnow()
        # recompute and make sure all schedules are closed time intervals
        schedules.append(new_schedule)
        self._recompute_schedules(schedules)
def set_schedule ( self , new_schedule ) : assert isinstance ( new_schedule , CDotWeeklySchedule ) , "setting schedule instance must be a CDotWeeklySchedule class" # first, set all the others to inactive schedules = self . get_schedules ( ) new_schedule . deprecated = False if new_schedule . started is None or new_schedule . started <= datetime . utcnow ( ) : new_schedule . started = datetime . utcnow ( ) # recompute and make sure all schedules are closed time intervals schedules . append ( new_schedule ) self . _recompute_schedules ( schedules )