Re: Using a single validator of a schema
Jason Culverhouse <[email protected]>
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Message-ID | <[email protected]> |
Ari,
I would think that you could just do something like:
class Registration(formencode.Schema):
first_name = validators.String(not_empty=True)
last_name = validators.String(not_empty=True)
email = validators.Email(resolve_domain=True)
def someMethodCalledFromTheWeb(name, value):
new_value = Registration.fields[name].to_python(value).
I you wanted to reuse the definitions that are already in the schema..
Jason
On Jan 28, 2006, at 6:04 PM, Ari Turpeinen wrote:
> Hi,
>
> Is there a way to use just one validator out of a schema?
>
> I use javascript on the client-side to send a request
> asking "is this input field ok?" when the field loses focus.
> It would be great if I could somehow reuse a part of a schema
> without having a full dictionary of values.
>
> Any links to documentation I may have missed greatly appreciated.
>
> -Ari Turpeinen
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through
> log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD
> SPLUNK!
> http://sel.as-us.falkag.net/sel?
> cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> FormEncode-discuss mailing list
> FormEncode-discuss-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/formencode-discuss
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642