From 0697565ea1056a72d3e0aed426cc848007dd2283 Mon Sep 17 00:00:00 2001 From: John Merlie Date: Sun, 2 Jul 2023 12:21:34 -0400 Subject: [PATCH] modified pumping amount graph --- reports/graphs/pumping_amounts.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/reports/graphs/pumping_amounts.py b/reports/graphs/pumping_amounts.py index 840ffd90..85b121a9 100644 --- a/reports/graphs/pumping_amounts.py +++ b/reports/graphs/pumping_amounts.py @@ -14,13 +14,13 @@ def pumping_amounts(objects): :param instances: a QuerySet of Pumping instances. :returns: a tuple of the the graph's html and javascript. """ - objects = objects.order_by("time") + objects = objects.order_by("start") # We need to find date totals for annotations at the end curr_date = "" date_totals = {} for object in objects: - date_s = timezone.localtime(object.time) + date_s = timezone.localtime(object.start) date_s = str(date_s.date()) if curr_date != date_s: date_totals[date_s] = 0.0 @@ -31,7 +31,7 @@ def pumping_amounts(objects): amounts = [] # Array of arrays containing amounts index_x, index_y = 0, -1 for object in objects: - date_s = timezone.localtime(object.time) + date_s = timezone.localtime(object.start) date_s = str(date_s.date()) if date_s not in dates: dates.append(date_s)