I have the following model:
class Ticket(models.Model):
# ... other fields omitted
active_at = models.DateTimeField()
duration = models.DurationField()
Given now = datetime.now()
, I'd like to retrieve all records for which now
is between active_at
and active_at + duration
.
I'm using Django 1.8. Here are the DurationField docs.