I have a question about django annotation methods: can I calculate the "maximum_discount" of these 3 specific discounts (and sort by this "maximum_discount")?
Product.objects\
.annotate(
product_discount=Max('discounts__amount'),
category_discount=Max('category__discounts__amount'),
brand_discount=Max('brand__discounts__amount')
)
source
share