I am trying to get the maximum and minimum model value using this query:
max_min_price = MyModel.objects.annotate(Min('price', Max('price')))
But I get the error:
Complex annotations require an alias
I'm not sure what the alias means here, and the docs are not clear in my opinion. Any advice would help.
django
alejoss
source share