[web2py] Re: how to limit query fields for grid

2016-07-10 Thread Alex Glaros
works perfectly now Anthony. Thanks! query = ((db.strategic_goal.transparency_level_fk == 1) & (db.strategic_goal.organization_fk == db.Organization.id)) [setattr(f, 'readable', False) for f in db.Organization if f.name not in ('Organization.organization_full_name')] grid = SQLFOR

[web2py] Re: how to limit query fields for grid

2016-07-10 Thread Anthony
Should be a list of field *names*, not Field objects (note, you are comparing with f.name). Anthony On Saturday, July 9, 2016 at 11:51:46 PM UTC-4, Alex Glaros wrote: > > am still not understanding a couple of the concepts > > the grid query is result of join so I assume I run one of these [set

[web2py] Re: how to limit query fields for grid

2016-07-09 Thread Alex Glaros
am still not understanding a couple of the concepts the grid query is result of join so I assume I run one of these [setattr] lines for each table that needs to have fields non-readable? The below code doesn't remove unwanted fields query = ((db.strategic_goal.transparency_level_fk == 1) & (d

[web2py] Re: how to limit query fields for grid

2016-07-09 Thread Anthony
On Saturday, July 9, 2016 at 4:07:43 PM UTC-4, Alex Glaros wrote: > > sorry, forgot to state that I tried the "fields = " parm which worked, > but then the extra, unwanted fields were visible from the default search > dropdown. Am I stuck having to write a long list of ".readable = False"? > Yes

[web2py] Re: how to limit query fields for grid

2016-07-09 Thread Alex Glaros
sorry, forgot to state that I tried the "fields = " parm which worked, but then the extra, unwanted fields were visible from the default search dropdown. Am I stuck having to write a long list of ".readable = False"? -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - h

[web2py] Re: how to limit query fields for grid

2016-07-09 Thread Anthony
It's in the book (hint, it's the second argument). On Saturday, July 9, 2016 at 4:57:12 AM UTC-4, Alex Glaros wrote: > > can someone please remind me of syntax for limiting fields in query for > grid? >

[web2py] Re: how to limit query fields for grid

2016-07-09 Thread Alex Glaros
the purpose is to reduce the amount of data that brought over, and reduce the number of .readable = False lines in controller for fields not wanted -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com