Il 19/01/16 03:17, 黄祥 ha scritto:
> just wondering why the requires list in a list type [] is not work
> properly when update (when insert goes fine):
> e.g.
> table.email.requires = IS_LIST_OF([IS_LOWER(), IS_EMAIL(),
> *IS_NOT_IN_DB(db, table.email)* ] )
In case of update I think you have to change the validator logic because
email uniqueness is no more requested or in case you update using a form
maybe the detect_record_change[1] can help you.

Cheers

    M.

[1]
http://web2py.com/books/default/chapter/29/07/forms-and-validators#Detect-record-change
>
> the problem when update is validator IS_NOT_IN_DB() is always true
> Value already in database or empty
>
> any idea how to face this?
>
> thanks and best regards,
> stifan
> -- 
> 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 [email protected]
> <mailto:[email protected]>.
> For more options, visit https://groups.google.com/d/optout.

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

Reply via email to