Hi all,
I'm attempting to make use of your DbFormPage class to generate forms that auto-populate based on database objects.
Consider the following code:
@expose('a_template')
def edit(self, **kw):
form = EditExperimentForm
form.fetch_data(request)
return dict(page='experiments',
form=form,
)
@expose()
@validate(EditExperimentForm, error_handler=edit)
def post_edit(self, **kw):
...
transaction.commit()
redirect('...')
fetch_data overwites any relevant validation data, so if a user posts a form with invalid information it's immediately discarded by that method.
Granted, I can write a separate method as the error handler - but is there a simple way to determine whether or not errors have been caught by the validator? If so, I can simple put a conditional statement in there and handle whether or not I bother fetching data.
Thanks!