Hi Anthony,

Can't you just do:
>
> SQLFORM.widgets.options.widget(f, v, _disabled=True, _class='generic_widget 
> form-control')
>
> Yes , that solves the issue, thanks.

 

>
> The fourth argument to IS_IN_DB is the error message, so a lambda wouldn't 
> go there. Perhaps you meant for that to be in place of the third argument, 
> which is for the labels. But what is wrong with the current "labels" 
> argument -- does it not produce the labels you want?
>
>
In your first reply you said: or you could write a custom validator for the 
field that automatically replaces the submitted value with the field's 
default in case the submitted value is None.

I first thought I could adjust the IS_IN_DB validator to accomplish this, 
on second thoughts, I understand you meant
writing a custom validator just to replace the submitted value with the 
value that's already in the database. However,
your first solution solves the issue, so no neeed to write a custom 
validator.

Best,

Annet 

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