I have this code:
def author(id):
if id is None:
return "Unknown"
else:
user = db.auth_user(id)
me=db(db.auth_user.id ==
id).select(db.auth_user.usealiasname).first().usealiasname
if me==False:
return '%(first_name)s %(last_name)s' % user if user else ''
else:
return '%(aliasname)s' % user if user else ''
I want to check if the user with a particular 'id' wants to use an
aliasname or real names. However it wont work. i know for sure this line is
the one that is wrong because without the condition it prints properly. can
somebody help. i am sure its simple but i cannot seem to figure it out.
me=db(db.auth_user.id ==
auth.user_id).select(db.auth_user.usealiasname).first().usealiasname
--
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 [email protected].
For more options, visit https://groups.google.com/d/optout.