Dear all
I need to make a summary from all records that return from sqlform.grid
(grid.rows) but grid.rows is contain records only for 1 page (default = 20
records display).
Anyone know, how to get all records from SQLFORM.grid.
Thank you in advance
Ariya
code
======
q0 = db.production_mc_shutdown.production_daily_task ==
db.production_daily_task.id
production_mc_shutdown__grid = SQLFORM.grid(q0 , create = False, deletable
= False, editable = False, details = False,
fields = [db.production_daily_task.id,
db.production_daily_task.mc_code,
db.production_daily_task.production_unit,
db.production_daily_task.production_lot_number,
db.production_daily_task.production_date,
db.production_daily_task.time_used
],
maxtextlength = 50,
paginate = 20,
ttl_shutdown = (sum([i.amount for i in
db(db.production_mc_shutdown.production_daily_task.belongs(i.id for i in
production_mc_shutdown__grid.rows)).select()]) or 0)
ttl_timeused = sum([i.time_used for i in production_mc_shutdown__grid.rows])
--
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.