Excuse me if I'm missing something (I don't know formencode and also didn't
read all your code), but couldn't you declare a callback within your view
and
set it as a validator of the field? Thus the validator could carry the
"context" of the view. The colander.Function validator could be used for
this:
def login(self):
schema = FormSchema()
def is_email_registered(value):
return model.useraccount.get_by_emailAddress(value)
schema['email_address'].validator =
colander.Function(is_email_registered,
message='This email is not
registered')
# ... deform form boilerplate
- D
2012/2/4 Jonathan Vanasco <[email protected]>
> Well... I could probably do these validations within the validators, I
> just don't want to.
>
> I've got the gist ( https://gist.github.com/1734244 ) working pretty
> much perfectly to handle my needs right now. I dropped all the
> 'validators' handling, and am just limiting it to schemas -- because
> its simpler and i don't need otherwise.
>
> i'll package it up into something and toss it on pypi later.
>
> --
> You received this message because you are subscribed to the Google Groups
> "pylons-discuss" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.