Commit 15e8f6eb authored by fred's avatar fred
Browse files

schedule: add property to get diffusion weeks as a short string

parent 3b2faf62
......@@ -80,6 +80,21 @@ class Schedule(models.Model):
return True
return False
def weeks_string(self):
if self.weeks == 0b0001:
return u'1er du mois'
elif self.weeks == 0b0010:
return u'2e du mois'
elif self.weeks == 0b0100:
return u'3e du mois'
elif self.weeks == 0b1000:
return u'4e du mois'
elif self.weeks == 0b0101:
return '1er et 3e'
elif self.weeks == 0b1010:
return '2e et 4e'
return None
def get_episode_image_path(instance, filename):
return os.path.join('images', instance.episode.emission.slug,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment