Commit 22d5425a authored by fred's avatar fred
Browse files

performance: get emission objects along the schedules

parent d683ab2b
......@@ -17,7 +17,7 @@ class ProgramView(TemplateView):
def get_context_data(self, **kwargs):
context = super(ProgramView, self).get_context_data(**kwargs)
schedules = Schedule.objects.all().order_by('datetime')
schedules = Schedule.objects.select_related().order_by('datetime')
days = []
for day in range(7):
days.append({'schedules': [x for x in schedules if x.is_on_weekday(day+1)],
Supports Markdown
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