def _get_schedule(self): schedule = CrontabSchedule.from_schedule( crontab(*self.schedule.split())) schedule.timezone = self.timezone if schedule.pk is None: schedule.save() return schedule
def create_model_crontab(self, schedule, **kwargs): crontab = CrontabSchedule.from_schedule(schedule) crontab.save() return self.create_model(crontab=crontab, **kwargs)
def _task(): schedule = crontab(minute='*/10') c = CrontabSchedule.from_schedule(schedule) c.save() return PeriodicTask.objects.create(name='t{0}'.format(next(_ids)), crontab=c)
def create_model_crontab(self, schedule, **kwargs): crontab = CrontabSchedule.from_schedule(schedule) crontab.save() return self.create_model(crontab=crontab, **kwargs)