Commit 3d6319b4 authored by fred's avatar fred

emissions: add get_absolute_url() method to Emission and Episode

parent dd03f568
......@@ -28,6 +28,8 @@ class Emission(models.Model):
categories = models.ManyToManyField(Category)
def get_absolute_url(self):
return reverse('emission-view', kwargs={'slug': str(self.slug)})
def __unicode__(self):
return self.title
......@@ -45,8 +47,8 @@ class Episode(models.Model):
def get_absolute_url(self):
return reverse('episode-view',
kwargs={'emission_id': str(,
'pk': str(})
kwargs={'emission_slug': str(self.emission.slug),
'slug': str(self.slug)})
class Diffusion(models.Model):
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