Ejemplo n.º 1
0
def repeat_task(date, command, interval):
    if interval < 30:
        raise ValueError('No repeats shorter than 30 seconds')

    t = ScheduledTasks()
    t.date = date
    t.command = command
    t.repeat = True
    t.repeat_interval = interval
Ejemplo n.º 2
0
def schedule_task(date, command):
    t = ScheduledTasks()
    t.date = date
    t.command = command
    t.repeat = False
    t.save()