Re: [web2py] How can I get value from my extra_fields?

2019-08-01 Thread Val K
Should be stored in the session too, did you try to logout/login?

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/49834975-956d-49e6-9817-929c66504a54%40googlegroups.com.


Re: [web2py] How can I get value from my extra_fields?

2019-08-01 Thread Константин Комков
It's query to database I thought that I can get it from session like
auth.user. Thank you for answer!

чт, 1 авг. 2019 г., 21:21 Val K :

> Try db.auth_user(auth.user_id).language
>
> --
> 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 a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/7cgw04bcOiA/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/web2py/2b60f329-b68f-4cc5-b5a2-fc9f23483d74%40googlegroups.com
> .
>

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/CAM7z-V%3Drr9yfMqZmLeWTdw%3D-s42HsehwzG8cpO%3DkiJyLzdb_oQ%40mail.gmail.com.


[web2py] How can I get value from my extra_fields?

2019-08-01 Thread Val K
Try db.auth_user(auth.user_id).language

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/2b60f329-b68f-4cc5-b5a2-fc9f23483d74%40googlegroups.com.


[web2py] How can I get value from my extra_fields?

2019-08-01 Thread Константин Комков
I added field 'language' im my auth_user table in database. My file db.py 
contain:
auth = Auth(db, host_names=configuration.get('host.names'))

*auth*
*.settings.extra_fields['auth_user']= [Field('language')]*
auth.define_tables(username=False, signature=False)
How can I get value of language for current login user?
myStr = ''
for a in auth.user:
myStr += a+': '+str(auth.user.get(a))+''
myStr >>>
id: 1
first_name: Константин
last_name: Комков
email: t...@gmail.com
registration_key: 
reset_password_key: 
registration_id:
test = str(auth.settings.extra_fields.get('auth_user')[0])
test >>>
auth_user.language

-- 
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 web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/58233646-4ca0-4b19-9e33-90536918a66e%40googlegroups.com.