Это будет работать, переопределить save()
метод Model
import datetime
NOW = datetime.date.today()
# it can be datetime.datetime.now() in case of using models.DateTimeField
class Track(models.Model):
act_time_start = models.DateField(null=True) # Use DateTimeField for comparison with date and time
act_time_finish = models.DateField(null=True)
active = models.BooleanField(default=False)
def save(self, *args, **kwargs):
if self.pk is None:
# Ensure that act_time_start and act_time_finish have date value
# i.e: if isinstance(self.act_time_start,datetime.date)
#
if self.act_time_start < NOW and NOW > self.act_time_finish:
self.active = True
super(Track, self).save(*args, **kwargs)