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
*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
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
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
4 matches
Mail list logo