Question Regarding Formencode With Pyramid

38 views
Skip to first unread message

svaha

unread,
Feb 1, 2011, 1:00:40 PM2/1/11
to pylons-devel
I've been working on a simple form submittal in Pyramid. I tried
Deform and Pyramid_Simpleform but I am using a lot of jQuery on the
form that I would like to keep.

Right now, I am using.
params = request.params
...
except formencode.Invalid, e:
request.error = e.error_dict
return HTTPFound(location = route_url('root', request))

This works, if I type in invalid fields it will reset the form... but
I want to display an error message on the form at the top with mako
templates, just '${error}'

What is the best way to do this? can I use HTTPFound? or is there an
easy way to rerender the form and pass the error value to it?

svaha

unread,
Feb 1, 2011, 10:34:28 PM2/1/11
to pylons-devel
Sweet. I figured this out..
Still a beginner's question. Feel free to delete this thread.

I needed:
return HTTPFound(location = route_url('root', request, _query=params))
Reply all
Reply to author
Forward
0 new messages