I'm designing a simple web app and I'd like a unified system for
storing errors to show in templates.
What I did initially was to create a custom request factory:
class UserRequest(Request):
errors = {}
and then I simply do request.errors[name] = error_text and read from
that dictionary on the template side.
The problem is that these errors seem to stick around... if I do
something that triggers an error, I get the page back with the error
text (great!) but then I surf to another page and type that URL back
into the address bar... and I get the error again.
So then I tried:
class UserRequest(Request):
errors = {}
def __init__(self, environ):
super(UserRequest, self).__init__(environ)
self.errors = {}
but now I *never* see errors!!
what's going on? how do I fix this?
--
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en.