20👍
✅
You need to give a name to the result of Min
, since Django wouldn’t be able to derive the name for complex aggregate functions:
max_min_price = MyModel.objects.annotate(min_price=Min('price', Max('price')))
Source:stackexchange.com