'Override to auto-set time_from and time_to'

def save(self, *args, **kwargs):

    if (hasattr(self, 'instance') and self.instance.time_to and (not self.instance.time_from)):
        minutes = long(self.cleaned_data['minutes'])
        hours = 0L
        days = 0L
        if (minutes >= 1440):
            hours = (minutes // 60)
            minutes %= 60
        if (hours >= 24):
            days = (hours // 24)
            hours %= 24
        delta = timedelta(days=days, hours=hours, minutes=minutes)
        self.instance.time_from = (self.instance.time_to - delta)
    return super(TaskTimeSlotForm, self).save(*args, **kwargs)
