Commit 84f09e2a authored by fred's avatar fred
Browse files

views: add variable with all episodes for emission template

parent 3bc4590b
......@@ -80,6 +80,23 @@ class EmissionMixin:
.distinct()
)
context['all_episodes'] = (
episodes_queryset.extra(
select={
'first_diffusion': 'emissions_diffusion.datetime',
},
select_params=(False, True),
where=[
'''datetime = (SELECT MIN(datetime)
FROM emissions_diffusion
WHERE episode_id = emissions_episode.id)'''
],
tables=['emissions_diffusion'],
)
.order_by('-first_diffusion')
.distinct()
)
context['futurEpisodes'] = (
episodes_queryset.extra(
select={
......
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