Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Order meals by time

Roland Geider6828ac77d34c
diff --git a/nutrition/models.py b/nutrition/models.py
index bb09799b7..094bd2f0e 100644
--- a/nutrition/models.py
+++ b/nutrition/models.py
@@ -155,6 +155,11 @@ class Meal(models.Model):
""" A meal
"""
+ # Metaclass to set some other properties
+ class Meta:
+ ordering = ["time", ]
+
+
plan = models.ForeignKey(NutritionPlan, verbose_name = _('Nutrition plan'))
order = models.IntegerField(max_length = 1, blank = True, verbose_name = _('Order'))
time = models.TimeField(null = True, blank = True, verbose_name = _('Time (approx)'))