I'm having trouble accessing variables after they get validated and
passed to the error_handler.
My code structure is as follows:
class UserAddSchema(validators.Schema):
email = validators.Email(not_empty=True)
fname = validators.String(not_empty=True)
lname = validators.String(not_empty=True)
@turbogears.expose(template=..)
def add(self, tg_errors=None)
if tg_errors: turbogears.flash("errors")
...
return dict()
@turbogears.expose()
@turbogears.validate(validators=UserAddSchema())
@turbogears.error_handler(add)
def save(self):
...
In my form, I have the variables: email, fname, lname (all text fields)
My form returns to save() which then sends it to UserAddSchema() to
validate. All this works. As desired, the program then goes to
error_handler add(). At this point, suppose I want to get the
variables like email, fname, or lname, how would I do that? I tried
accessing email, but I found that it was equal to None.
Thanks so much!
Frank
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---