On Tuesday, March 17, 2015 at 12:38:18 PM UTC-7, Spokes wrote: > > I'd like to get the id associated with each row of a grid. The grid is > created like this: > > field_names = ['id'] > field_list = [f for f in db.t_table1 if f.name in field_names] > > query = (db.t_table1.id > 0) > > grid = SQLFORM.grid(query, fields = field_list, orderby = '<random>', > ... ) > > What's the best way to obtain a list of the ids? >
I must be missing something, because it looks to me like the code above only gets a list of ids. The conditional in the list comprehension will only match for one field. /dps -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.