how to make an ORM query with month and year of datefield.
select sum(price) from mytable group by month(start_date),year(start_date);
The above query which is giving the exact result. But in the ORM i tried but how to group by month and year wise.
My ORM query
rv_per_month = Price_Report.objects.filter(item__in=item_Arr).aggregate(Sum('revenue'))
The above orm query which is giving the sum(price) . But I want it as group by month and year