On Wednesday, March 9, 2016 at 2:37:35 PM UTC-5, Ron Chatterjee wrote:
>
> db.auth_user.id 
>

No, db.auth_user.id is simply a Field object, representing the "id" field 
in the auth_user table model definition.
 

> Or 
> auth.user_id
>

In the above, "auth" refers to the instantiation of the Auth object via 
Auth(db, ...) -- it is not a database table model. auth.user_id holds the 
ID of the currently logged in user. auth.user is the record of the 
currently logged in user from the db.auth_user table. auth.user.id is 
therefore also the ID of the currently logged in user -- however, 
auth.user_id is preferred, because it returns None in case no user is 
logged in, whereas auth.user.id will throw an exception.

Anthony

-- 
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.

Reply via email to