In Django ORM, “values” and “annotate” are not working to group by
问题 I have a table like this: Now I want to sum up the meals on each date. I have written the code below. But it doesn't work as I wanted. Model: class Meal(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, default=1) date_of_meal = models.DateField() morning_meal = models.SmallIntegerField(default=0) mid_day_meal = models.SmallIntegerField(default=0) night_meal = models.SmallIntegerField(default=0) updated = models.DateTimeField(auto_now=True, auto_now_add=False) timestamp =