Re: Groups and summarys in template

2019-12-01 Thread Integr@te System
Hi Man, Plz try: desired_value = Account.object.aggregate( subtotal = sum('Value', filter = Q(Date = date.todat( On Mon, Dec 2, 2019, 07:14 Elias Coutinho wrote: > Well, the result I expect is a list with subtotals similar to the figure > below: > > [image: image.png] > > Can you do it wi

Re: Groups and summarys in template

2019-12-01 Thread Elias Coutinho
Well, the result I expect is a list with subtotals similar to the figure below: [image: image.png] Can you do it without javascript? Em sáb., 30 de nov. de 2019 às 03:36, Dvenum escreveu: > Not sure I understand, what you doing, but you may use F() expression to > compare fields in the query:

Re: Groups and summarys in template

2019-11-29 Thread Integr@te System
Hi, You can sellect from SO(relate to 'sold_value') as retrieve from new SO base on current time. Or If due date time == datetime now && 'due date' != 0: retrieve 'due date' On Sat, Nov 30, 2019, 02:36 Elias Coutinho wrote: > Good afternoon people! > > I have the following querysets: > >

Re: Groups and summarys in template

2019-11-29 Thread Dvenum
Not sure I understand, what you doing, but you may use F() expression to compare fields in the query: https://docs.djangoproject.com/en/2.2/ref/models/expressions/#f-expressions On Sat, Nov 30, 2019 at 2:36 AM Elias Coutinho wrote: > Good afternoon people! > > I have the following querysets: > >

Groups and summarys in template

2019-11-29 Thread Elias Coutinho
Good afternoon people! I have the following querysets: accounts = Account.objects.filter (person__is_representative = False) .order_by ('due date') groups = Account.objects.values ('due_date'). annotate (total_day = Sum ('sold_value')). order_by ('due_date') Accounts Returns a List