[web2py] Re: What can cause some of my extra fields to be missing from auth.user?

2014-07-28 Thread Leonel Câmara
I have found the problem. The extra fields weren't showing up because auth.user uses the row stored in Session which didn't have these fields yet, whereas db.auth_user[user_id] doesn't. Not sure how we should deal with this, should auth invalidate all sessions if it detects a field change, or

[web2py] Re: What can cause some of my extra fields to be missing from auth.user?

2014-07-28 Thread Massimo Di Pierro
I would simply add one line the book. Do you want to propose it? On Monday, 28 July 2014 10:51:49 UTC-5, Leonel Câmara wrote: I have found the problem. The extra fields weren't showing up because auth.user uses the row stored in Session which didn't have these fields yet, whereas

[web2py] Re: What can cause some of my extra fields to be missing from auth.user?

2014-07-27 Thread Massimo Di Pierro
The computed fields are missing if computation fails. Try pass a function to compute=myfunc and use a try except within the function to determine if the function is being called and if it fails. Normally it fails silently if a parameter required for the computation is missing. On Thursday, 24

[web2py] Re: What can cause some of my extra fields to be missing from auth.user?

2014-07-27 Thread Anthony
He's saying the value is there when viewing the record via db.auth_user[auth.user_id] (so it has been computed) but it doesn't show up in auth.user. On Sunday, July 27, 2014 12:17:09 PM UTC-4, Massimo Di Pierro wrote: The computed fields are missing if computation fails. Try pass a function

[web2py] Re: What can cause some of my extra fields to be missing from auth.user?

2014-07-27 Thread Massimo Di Pierro
This works for me: from gluon.tools import Auth db = DAL() auth = Auth(db) auth.settings.extra_fields['auth_user'] = [Field('test',compute=lambda row: row.email)] auth.define_tables() db.auth_user.insert(email='massimo.dipie...@gmail.com',password=CRYPT()('test')[0]) 1L user =

[web2py] Re: What can cause some of my extra fields to be missing from auth.user?

2014-07-25 Thread Leonel Câmara
Do you guys need an example application where this problems happens? -- 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