comment_form = widgets.TableForm(
fields=CommentFields(),
action="save"
)
@expose(template=".templates.form")
def add(self, tg_errors=None):
if tg_errors:
flash("There was a problem with the form!")
return dict(form=comment_form)
@expose()
@validate(form=comment_form)
@error_handler(add)
def save(self, **data):
#...
And, for whatever reason, your user ends up at "host.com/add/" instead of "host.com/add", the form will display fine, but will point to "host.com/add/save" instead of "host.com/save". Then you'll get all kinds of fun errors, like "TypeError: add() got an unexpected keyword argument '
No comments:
Post a Comment