via FormEncode under Pylons, I was able to mark a valid field as
invalid, and then reprint.
i'm wondering if this is possible with deform.
a pseudocode example of this in action would be something like this:
def login(self):
formLogin = deform.Form(FormLogin(_)
posted = self.request.POST.items()
try:
appstruct = self.formLogin.validate(posted)
account =
model.useraccount.get_by_emailAddress(posted['email_address'])
if not account:
# mark a field as invalid
self.formLogin.mark_invalid( 'email address' , "This
email is not registered")
# invalidate the form to raise an exception
self.formLogin.invalidate()
except deform.ValidationFailure, e:
self.formLogin= e
return self._login_print()
--
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.