summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2011-03-21 14:58:30 (GMT)
committerErnesto Rico-Schmidt <e.rico.schmidt@gmail.com>2011-03-21 14:58:30 (GMT)
commit4d63cb721d78a8bf6d5b4af095fde07c72abf13c (patch)
treea0878fd9e1586311515d63bbf12c246c3e5de019 /program
parent4b4324459e4e6669519d2c2904b9e1de83b30944 (diff)
modified Time slot: added redundant field.
Diffstat (limited to 'program')
-rw-r--r--program/models.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/program/models.py b/program/models.py
index 3864381..8aac8cc 100644
--- a/program/models.py
+++ b/program/models.py
@@ -217,6 +217,7 @@ class TimeSlot(models.Model):
programslot = models.ForeignKey(ProgramSlot, related_name='timeslots', verbose_name=_("Program slot"))
start = models.DateTimeField(_("Start time"))
end = models.DateTimeField(_("End time"))
+ show = models.ForeignKey(Show, editable=False)
class Meta:
ordering = ('start', 'end')
@@ -227,10 +228,12 @@ class TimeSlot(models.Model):
start = self.start.strftime('%d. %b %Y %H:%M')
end = self.end.strftime('%H:%M')
- return u'%s: %s - %s' % (self.show(), start, end)
+ return u'%s: %s - %s' % (self.show, start, end)
+
+ def save(self, *args, **kwargs):
+ super(TimeSlot, self).save(*args, **kwargs)
- def show(self):
- return self.programslot.show
+ self.show = self.programslot.show
@models.permalink
def get_absolute_url(self):