Something like that :

form_fields.append(db[request.args(0)][f].clone(requires=IS_EMPTY_OR(db[request.args(0)][f].requires)))

Richard

On Mon, Dec 4, 2017 at 3:13 PM, Richard Vézina <[email protected]>
wrote:

> I think you have to clone the field, in context of .factory
>
> Richard
>
> On Mon, Dec 4, 2017 at 2:53 PM, Morganti <[email protected]> wrote:
>
>> Hi,
>>
>> I am creating a form with SQLFORM.factory. I have a field 'username' and
>>
>> Field('username','string',requires=[IS_NOT_EMPTY(),
>> IS_NOT_IN_DB(db,'auth_user.username')]
>>
>> and when try to use I am having the error:
>>
>> <type 'exceptions.Exception'> Validation error, field:username
>> <gluon.validators.IS_NOT_IN_DB object at 0x7ffaa4136310>
>>
>> What's wrong?
>>
>> Thanks
>> BR
>> André
>>
>> --
>> 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.
>>
>
>

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