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