After digging a bit in the code and finding a page that was close to
what I needed, the following works as expected:

model:

passwordValidator = Schema(chained_validators=(FieldsMatch('password',
 
'passwordverify',
                                                            messages=
{'invalidNoMatch':"New Passwords do not match"}),))

class password_form(TableForm):
    class fields(WidgetsList):
      oldpassword = PasswordField(validator=NotEmpty)
      password = PasswordField(validator=NotEmpty)
      passwordverify = PasswordField(validator=NotEmpty)

change_password_form = password_form('change_password_form',
action='passwordsave', validator=passwordValidator)

controller:

    @expose('cp.templates.template')
    def password(self, **kw):
        pylons.c.form = change_password_form
        return dict(value = null, template='form')

    @validate(change_password_form, error_handler=password)
    def passwordsave(self, oldpassword, password, passwordverify):
        flash("Password updated")
        redirect('password')

Documented in case someone else runs across the same issue.  This page
documented the solution needed.

http://www.turbogears.org/2.0/docs/main/ToscaWidgets/Cookbook/PasswordValidation.html


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to