views:

22

answers:

1

When a user sends a filled form, I want to print an error message in case there is an input error. One of the GAE sample codes does this by embedding the error message in the URI.

Inside the form handler (get):

self.redirect('/compose?error_message=%s' % message)

and in the handler (get) of redirected URI, gets the message from request:

values = {
    'error_message': self.request.get('error_message'),
    ...

Is there a way to accomplish the same without embedding the message in the URI?

+1  A: 

Is the values dict being rendered by the template engine? If so, you can pass the error string directly like this:

values = {
    'error_message': 'there is an error',
    ...
jbochi
This seems to have worked, thanks
hyn