Self hosted FLOSS fitness/workout, nutrition and weight tracker
Use an ordered dictionary for log result
Roland Geider7d7b7478ce76
diff --git a/wger/nutrition/models.py b/wger/nutrition/models.pyindex a7b9be776..b299e53bf 100644--- a/wger/nutrition/models.py+++ b/wger/nutrition/models.py@@ -18,6 +18,7 @@import loggingimport datetimefrom decimal import Decimal+from collections import OrderedDictfrom django.db import models@@ -204,7 +205,7 @@ class NutritionPlan(models.Model):'''Returns an overview for all logs available for this plan'''- result = {}+ result = OrderedDict()for date in self.logitem_set.datetimes('datetime', 'day', order='DESC'):result[date] = self.get_log_summary(date=date)return result