Changes between Initial Version and Version 1 of Ticket #20930, comment 6


Ignore:
Timestamp:
Aug 20, 2013, 1:52:15 AM (11 years ago)
Author:
Debanshu Kundu

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #20930, comment 6

    initial v1  
    88
    99{{{
    10 Xyz.objects.values('user').annotate(total_a=Sum('a'), total_b=Sum('b')).values(F('total_a')/F('total_b')*100)
     10Xyz.objects.values('user').annotate(total_a=Sum('a'), total_b=Sum('b')).values('user', ratio_percent=F('total_a')/F('total_b')*100)
    1111}}}
    1212
    13 **But**, in case of `aggregate` this wont work as `aggregate` returns `dict` (not `QuerySet`). So, I guess some changes are required for `aggregate`.
     13**But**, in case of `aggregate` this wont work as `aggregate` returns `dict` (not `QuerySet`). So, I guess some changes are required for `aggregate`. Also, both functionalities (operations on aggregates and passing F objects to aggregates) can co-exist (as I think).
Back to Top