I have the following models:
from django.db import models
class Topping(models.Model):
# ...
price = models.IntegerField()
class Pizza(models.Model):
# ...
toppings = models.ManyToManyField(Topping)
I need to get following query:
my_query = Pizza.objects.all().annotate(
topping_with_min_price="get id of topping with the minimal price")
So, how to get that?