diff options
author | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2014-03-07 19:09:16 (GMT) |
---|---|---|
committer | Ernesto Rico-Schmidt <e.rico.schmidt@gmail.com> | 2014-03-07 19:09:16 (GMT) |
commit | a1e6deb0bf70944a70111c41438456abe2f867e3 (patch) | |
tree | 4ce1741a8097e1a26fcced7c07f593995cd3ec70 /program/models.py | |
parent | 2638a34a18673c48c6bdbf31b057bbcf03c6aed2 (diff) |
fixed day_schedule to export 00:00 - 23:59:59 and not between 06:00 and 05:59
also added show name to json export
Diffstat (limited to 'program/models.py')
-rw-r--r-- | program/models.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/program/models.py b/program/models.py index 89e2fa7..7cdc345 100644 --- a/program/models.py +++ b/program/models.py @@ -419,6 +419,12 @@ class TimeSlotManager(models.Manager): return TimeSlot.objects.filter(models.Q(start__lte=today, end__gte=today) | models.Q(start__gt=today, start__lt=tomorrow)).exclude(end=today) + def get_24h_timeslots(self, start): + end = start + timedelta(hours=24) + + return TimeSlot.objects.filter(models.Q(start__lte=start, end__gte=start) | + models.Q(start__gt=start, start__lt=end)).exclude(end=start) + class TimeSlot(models.Model): programslot = models.ForeignKey(ProgramSlot, related_name='timeslots', verbose_name=_("Program slot")) start = models.DateTimeField(_("Start time"), unique=True) |