Hi Massimo,

Thanks for your (quick) answer! I've created an issue for this: 
http://code.google.com/p/web2py/issues/detail?id=900

I'll try to implement the modern approach and the 'requires work-around'

Remco

On Tuesday, July 17, 2012 4:03:20 AM UTC+2, Massimo Di Pierro wrote:
>
> For the time being... remove unique=True and use 
> requires=(IS_EMAIL(),IS_NOT_IN_DB(db,'auth_user.email'))
>
> On Monday, July 16, 2012 9:01:54 PM UTC-5, Massimo Di Pierro wrote:
>>
>> This is a bug. The archive function creates a an auxiliary table to store 
>> copies of the current record. 
>> It reproduces the same table structure as your table including 
>> (incorrectly) the unique attribute. 
>> This fails when you insert ore than one revision.
>>
>> Please open a ticket on google code. This is also an issue with the more 
>> modern approach 
>>
>> auth.enable_record_versioning(db)
>>
>>
>> On Monday, July 16, 2012 4:54:54 PM UTC-5, Remco K wrote:
>>>
>>> Hi everyone,
>>>
>>> I got stuck in creating an update form for an auth_user.
>>>
>>> In the auth_user table i made an extra field:
>>>
>>> Field('email', length=128, default='', unique=True, notnull=True),
>>>
>>> Now everytime i try to update the user information (the last name) i get 
>>> the error:
>>>
>>> IntegrityError: column email is not unique
>>>
>>> I try to combine updating the user information with creating an archive 
>>> entry for the previous entry:
>>>
>>> _id = db.auth_user(request.args(0)) or redirect(URL('index'))
>>> form = SQLFORM(db.auth_user, _id)
>>> if form.process(onsuccess=auth.archive).accepted:
>>>
>>> This method works for an other table which doesnt have an Field with 
>>> Unique=True but not for this table with this Unique=True value.
>>>
>>> Someone who can help me out a bit?
>>>
>>> Thanks in advance!
>>> Remco
>>
>>

-- 



Reply via email to