diff options
author | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2011-07-24 16:42:08 (GMT) |
---|---|---|
committer | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2011-07-24 16:42:08 (GMT) |
commit | 14f692cc393490087f154cd015129da4573724d5 (patch) | |
tree | 5cde6ebae3eab67f7c7e92df852fb92178601426 /program | |
parent | 7f7e61b0200f9acab55dd4b95aa81ec372d693f4 (diff) |
extended query for get_day_timeslots.
Diffstat (limited to 'program')
-rw-r--r-- | program/models.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/program/models.py b/program/models.py index 8f2e50b..ef3ee0c 100644 --- a/program/models.py +++ b/program/models.py @@ -256,7 +256,7 @@ class TimeSlotManager(models.Manager): today = datetime.combine(day, time(6,0)) tomorrow = today + timedelta(days=1) - return TimeSlot.objects.filter(start__range=(today, tomorrow)) + return TimeSlot.objects.filter(models.Q(start__lte=today, end__gte=today) | models.Q(start__gt=today, start__lt=tomorrow)) class TimeSlot(models.Model): programslot = models.ForeignKey(ProgramSlot, related_name='timeslots', verbose_name=_("Program slot")) |