When a user is logged in, the user record (i.e., auth.user) is stored in 
the session -- it does not get updated from the database on every request, 
as that would require too many database hits. It will be updated the next 
time that user logs in.

Anthony

On Sunday, May 29, 2016 at 2:43:02 PM UTC-4, Pierre wrote:
>
> Hi,
>
> I defined an auth_user  boolean extra field which default value is False 
> then I updated its value to True
> Now if I login with this user and try to access the boolean value via* 
> auth.user.extraField* it's still False 
> here is the controller.function:
>
> def auser():
>     u= auth.user.username
>     m = auth.user.email
>     g= auth.user.geolocated
>     r= db.auth_user(id=auth.user_id)
>     gg = r.geolocated
>     return locals()
>
> this gives : g=False and  gg=True   
>
>
> here is the field definition in db.py:
>
> auth = Auth(db)
>
> auth.settings.extra_fields['auth_user']=[Field('geolocated','boolean', 
> default=False)]
>

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