Thanks Massimo, that solved it!
On Wednesday, August 29, 2012 11:07:03 PM UTC+2, Massimo Di Pierro wrote:
>
> Fixed in trunk! Thanks for reporting this is was a serious issue. Please
> check it. Both row['email'] and row.email should work now. Notice that
> your compute callback returns always None. I assume that is intentional?
>
> On Wednesday, 29 August 2012 14:19:59 UTC-5, Daniel Gonzalez wrote:
>>
>> # Use the authorization table for users
>> web2py_user_table = auth.settings.table_user_name
>> db.define_table(
>> web2py_user_table,
>> Field('email', unique=True),
>> Field('wav_user_doc_id', length=128, compute=create_new_wav_user
>> ),
>> Field('password', length=512, compute=automatic_password,type
>> ='password', readable=False, label='Password'),
>> # These fields are needed for authorization
>> Field('registration_key', length=512, writable=False, readable=
>> False, default=''),
>> Field('reset_password_key', length=512, writable=False, readable=
>> False, default=''),
>> Field('registration_id', length=512, writable=False, readable=
>> False, default=''),
>> format = '%(email)s')
>>
>> and
>>
>> def create_new_wav_user(row):
>> log.info('row=%s' % (row))
>> try:
>> email = row['email']
>> except:
>> log.error('No email provided, row=%s' % (row))
>> return None
>> ...
>> ...
>>
>> I have tried both: email = row['email'] and email = row.email
>>
>> On Wednesday, August 29, 2012 9:12:10 PM UTC+2, rochacbruno wrote:
>>>
>>> can you show the code?
>>>
>>> I am using
>>>
>>> db.table.field.compute = lambda row: row.otherfield
>>>
>>>
>>>
>>> On Wed, Aug 29, 2012 at 4:09 PM, Daniel Gonzalez <[email protected]>wrote:
>>>
>>>> Hi,
>>>>
>>>> I have recently updated trunk.
>>>>
>>>> I am using a compute function when creating new entries. In the compute
>>>> function I access the field row.email. Previously this was giving me the
>>>> *value* of the field, now I just get a reference to "gluon.dal.Field".
>>>>
>>>> Is this expected? How can I access the value of the field?
>>>>
>>>> Thanks,
>>>> Daniel
>>>>
>>>> --
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
--