SVN 1590 with SQLA patches.

I'm using widgets to create a form and thought that the widgets
automagically displayed error messages when a FormEncode validation
failed, but I'm getting back the form with no errors displayed.  Here
is what my code looks like.

class PlanReviewSchema(validators.Schema):
    title = validators.String(not_empty=True)

def createPlanReviewForm(controller=None):
    # some stuff
    form = TableForm(fields=fields, action="save", submit_text="Save",
                                  validator=PlanReviewSchema())

class PlanReviewController(controllers.RootController,
RESTfulController):

    # Some methods.
    # ...

    @expose(template="tgwater.planreview.templates.edit")
    def edit(self, obj):
        form = createPlanReviewForm()
        return dict(project=obj, form=form)

    @expose()
    @validate(form=createPlanReviewForm)
    @error_handler(edit)
    def save(self, project, **data):
        tg.flash("Changes saved!")
        raise tg.redirect("/")

I purposely leave the "title" field empty so the validator fails and
the "edit" method gets called because it is the error_handler.  But why
is there not an error message next to "title" on the form?

Randall


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

Reply via email to