Maybe it's possible to save your generated form in a session, and then
reuse it in the later method?
#initial form display
@turbogears.expose(html="project.templates.some_template")
def some_form_to_display(self, **kw):
cherrypy.session.some_form = TableForm(......... #generate widgets
)
return dict(some_form=some_form_from_somewhere)
#error handling and processing method
@turbogears.expose(html="project.templates.process_form",
inputform=cherrypy.session.some_form )
def process_form(self, **kw):
if cherrypy.request.form_errors:
return dict(some_form=some_form_from_somewhere)
else:
#do processing
raise cherrypy.HTTPRedirect(turbogears.url("/final_success"))
Or would this be too hackish? I would certainly like an answer on how
to generate a form on the spot instead of using something from session.
Are the decorators pulling us down in this case? Maybe there's a way to
do whatever inputform=... is doing manually?