]> git.0d.be Git - panikweb.git/commitdiff
put reruns after original diffusion schedule
authorFrédéric Péters <fpeters@0d.be>
Sat, 28 Sep 2013 07:08:27 +0000 (09:08 +0200)
committerFrédéric Péters <fpeters@0d.be>
Sat, 28 Sep 2013 07:08:27 +0000 (09:08 +0200)
panikweb/views.py

index 68bbf7e7ee6318cf8bee5b1abd0a93645cc27ac0..0fb63d618e097b7dad5e225dc3b7d7b962a99493 100644 (file)
@@ -81,7 +81,8 @@ class EmissionDetailView(DetailView, EmissionMixin):
     def get_context_data(self, **kwargs):
         context = super(EmissionDetailView, self).get_context_data(**kwargs)
         context['sectionName'] = "Emissions"
-        context['schedules'] = Schedule.objects.select_related().filter(emission=self.object).order_by('datetime')
+        context['schedules'] = Schedule.objects.select_related().filter(
+                emission=self.object).order_by('rerun', 'datetime')
         context['news'] = NewsItem.objects.all().filter(emission=self.object.id).order_by('-date')[:3]
         context.update(self.get_emission_context(self.object))
         return context
@@ -108,7 +109,8 @@ class EmissionEpisodesDetailView(DetailView, EmissionMixin):
     def get_context_data(self, **kwargs):
         context = super(EmissionEpisodesDetailView, self).get_context_data(**kwargs)
         context['sectionName'] = "Emissions"
-        context['schedules'] = Schedule.objects.select_related().filter(emission=self.object).order_by('datetime')
+        context['schedules'] = Schedule.objects.select_related().filter(
+                emission=self.object).order_by('rerun', 'datetime')
 
         context['search_query'] = self.request.GET.get('q')
         if context['search_query']: