Re: [web2py] count() as a field in sqlform.grid

2020-07-14 Thread Vlad
Perfect solution for me; somehow didn't think about it - Thank you! On Tuesday, July 14, 2020 at 2:51:59 AM UTC-4, AGRogers wrote: > > Can you add a virtual field to the Cart table to do the counting for you? > > On Tue, 14 Jul 2020, 4:34 pm Vlad, > > wrote: > >> The following doesn't work:

Re: [web2py] count() as a field in sqlform.grid

2020-07-14 Thread AGRogers
Can you add a virtual field to the Cart table to do the counting for you? On Tue, 14 Jul 2020, 4:34 pm Vlad, wrote: > The following doesn't work: > > fields = [db.cart.id, db.cart.id.count()] > > > grid = SQLFORM.grid(db.cart, > fields=fields, >

[web2py] count() as a field in sqlform.grid

2020-07-14 Thread Vlad
The following doesn't work: fields = [db.cart.id, db.cart.id.count()] grid = SQLFORM.grid(db.cart, fields=fields, left = [db.cart_content.on(db.cart.id==db. cart_content.cart)], groupby=db.cart.id) what's the best