Commit b5074f7e authored by gijs's avatar gijs

Avoid grouping of events in the loops.

parent 34adea1c
......@@ -65,8 +65,9 @@ def findProject(day, project):
return None
def addEvent(day, event):
index = findProject(day, event.project)
def addEvent(day, event, groupByProject = False):
index = findProject(day, event.project) if (groupByProject) else None
if index is None:
day['entries'].append(makeEntry(event.project, event))
else:
......@@ -132,7 +133,7 @@ def structureLoopEvents(start=None, end=None):
if not day or day['date'] != date:
day = days[(date-start).days]
addEvent(day, event)
addEvent(day, event, groupByProject=False)
# day['events'].append(event)
return (continuous, days)
......@@ -154,7 +155,7 @@ def structureInterbellumEvents(start=None, end=None):
days.append(day)
day = makeTemplateLoopDay(date=date, events=[])
addEvent(day, event)
addEvent(day, event, groupByProject=True)
if day:
# Where still working on a day
......@@ -233,6 +234,9 @@ def homeBeta(request):
interbellum = Interbellum(continuous=continuous, days=days, t=len(loops) + .5)
timelineEntries.append(interbellum)
from django.db import connection
print(connection.queries)
return render(request, 'contour/home.beta.html', {
'timelineEntries': timelineEntries,
'timelineLabels': timelineLabels,
......
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