order auto episodes chronologically
authorFrédéric Péters <fpeters@0d.be>
Thu, 12 Mar 2020 11:47:42 +0000 (12:47 +0100)
committerFrédéric Péters <fpeters@0d.be>
Thu, 12 Mar 2020 11:47:42 +0000 (12:47 +0100)
panikombo/models.py

index 2f96689..5164d6d 100644 (file)
@@ -124,7 +124,7 @@ class EpisodeAutoSelectionCell(CellBase):
                     where=['''datetime = (SELECT MIN(datetime) FROM emissions_diffusion
                                            WHERE episode_id = emissions_episode.id)'''],
                     tables=['emissions_diffusion'])
-            episodes_queryset = episodes_queryset.order_by(Lower('title')).distinct()
+            episodes_queryset = episodes_queryset.order_by('first_diffusion').distinct()
         elif self.period == 1:
             episodes_queryset = episodes_queryset.extra(
                     select={ 'first_diffusion': 'emissions_diffusion.datetime', },