Overriding sprox admin form edit validator (un requiring a field)

25 views
Skip to first unread message

Alon Nisser

unread,
Sep 21, 2012, 4:25:40 AM9/21/12
to sp...@googlegroups.com
I'm using  customized sprox tables and (soom) forms in tg admin controller - when I submit a form with some empty fields I get a red " Please enter a value" message besides each empty fields. the problem is - it shouldn't validate those fields, I'm perfectly happy with them empty.  I'm not talking about removing specific fields from the form (which I could easily enough do with __omit_fields__) since the empty fields vary in different scenarios. I just need sprox to "Un require" a specific list of (could) be empty fields.

how can I achieve this? couldn't find it the docs

using tg 2.1.3

thanks for the help

Jorge Vargas

unread,
Sep 21, 2012, 8:04:07 AM9/21/12
to sp...@googlegroups.com
By default sprox reads your __model__ definition add required
instructions from __require_fields__ then removes __omit_fields__ and
that's the validation it uses. So if you are not setting those field
specifically in __require_fields__ then they are being set in the
model layer. Perhaps your SQLAlchemy classes have fields for those as
"Not Null" which Sprox translates into non empty on submit.
Reply all
Reply to author
Forward
0 new messages