I\'m building a food logging database in Django and I\'ve got a query related problem.
I\'ve set up my models to include (among other things) a Food model connected
Perhaps something like this?
Food.objects.filter(consumer__user=user)\ .annotate(consumption_times=Count('consumer'))\ .order_by('consumption_times')