[web2py] Re: conditional in smartgrid that refer to the boolean type of field

2015-05-13 Thread Dave S
On Wednesday, May 13, 2015 at 1:19:31 AM UTC-7, 黄祥 wrote: > > *work* > editable = auth.has_membership('Manager') and (lambda row : > row.is_authorized == False) > > *not work (no error occured, the result is not expected)* > editable = (lambda row : row.is_authorized == False) and > auth.has_me

[web2py] Re: conditional in smartgrid that refer to the boolean type of field

2015-05-13 Thread 黄祥
*work* editable = auth.has_membership('Manager') and (lambda row : row.is_authorized == False) *not work (no error occured, the result is not expected)* editable = (lambda row : row.is_authorized == False) and auth.has_membership('Manager') why the first is work yet the second result is not exp

[web2py] Re: conditional in smartgrid that refer to the boolean type of field

2013-09-12 Thread 黄祥
thank you so much for your detail explaination, niphlod. it works well, now. e.g. def __grid_1(header, detail): is_authorized = lambda row : row.is_authorized == True is_not_authorized = lambda row : row.is_authorized == False if is_not_authorized: grid = SQLFORM.smartgrid(header, linked_tables=[d

[web2py] Re: conditional in smartgrid that refer to the boolean type of field

2013-09-12 Thread Niphlod
db.invoice_header.is_authorized is a Field. it's not a record fetched from the db... you'd likely want to check if any record of the table has an is_authorized field thjat carries True as a value, not the field definition ^_^ tl;dr: if you have a bunch of rows in that table and users should be