> On 3 April 2010 17:10, mdipierro <[email protected]> wrote:
>> Because in the lambda is call somewhere inside web2py whete is_empty
>> is not in the scope.
>>
>> db.policies_and_strategies.url.represent = lambda value:
>> local.is_empty(value) == None or A('url',_href=value)
>>
>> it is a python weirdness. You can fix it like this:
>>
>> db.policies_and_strategies.url.represent = lambda
>> value,is_empty=local.is_empty: is_empty(value) == None or
>> A('url',_href=value)
Sorry, but I still get
File "/home/js/web2py/applications/sadec/controllers/default.py", line
21, in show_policy
db.policies_and_strategies.url.represent = lambda
value,is_empty=local.is_empty: is_empty(value) == None or
A('url',_href=value)
AttributeError: 'module' object has no attribute 'is_empty'
Regards
Johann
--
"Every good gift and every perfect gift is from above,
and cometh down from the Father of lights, with whom
is no variableness, neither shadow of turning."
James 1:17
--
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en.