Thanks to all for your support @Anthony, I have done this way!! That provie all values sum which is having in grid. #controller.py
grid = SQLFROM.grid(query,..,...) a = grid.__dict__ b = sum([int(i.number_of_bags) for i in a['dbset'].select()]) Please, Let let me know if any other way to do that!! Best, Sandeep On Thu, Jul 26, 2018 at 3:13 AM Anthony <[email protected]> wrote: > On Wednesday, July 25, 2018 at 5:41:26 PM UTC-4, Anthony wrote: >> >> On Wednesday, July 25, 2018 at 3:49:09 PM UTC-4, pbreit wrote: >>> >>> How about JavaScript? >>> >>> >>> https://www.oreilly.com/library/view/javascript-cookbook/9781449390211/ch04s07.html >>> >> >> Having the database do it is most efficient -- you neither have to get >> all the data from the database into the Python environment, nor then send >> it all to the browser -- just let the database do the calculations directly >> and send only the result to the browser. >> > > Also, note that the linked solution would sum only the values displayed in > a single page of the grid, but the goal is to sum all the values in the > database table. > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

