>
>
>>
> If you want the items in field1 to be uinique then you cannot allow update 
> to put a duplicate value in there.
>
> If you get that message, find the duplicate value in the database and do 
> something about that.
>
> Regards
> Johann
>
>  
As I mentioned, it's difficult to explain :)

I don't want to create a duplicate using update(), what I meant is that 
message comes even though that field1 is still unique, I'm updating field2 
after all.
For now I managed to workaround the issue by a simple check in the 
controller:

if request.method =="update":
  field1.requires = None
else:
  field1.requires = IS_EMPTY_OR(IS_NOT_IN_DB(db, 'table.field1'))

I just hope it doesn't cause some nasty side effects.

Claudio

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to