Hi.
I'm trying to set an attribute on c from a decorator, like so:
def dec1():
def wrap_fn(f):
c.msg = 'hi'
return f
return wrap_fn
@dec1
def create(self):
return render('create_tmpl')
My template contains ${c.msg}
When the web server restarts to apply to code changes, and I load the
page up, "hi" is displayed as you would expect. HOWEVER, any
subsequent requests yield an error. It only works for the first
request.
AttributeError: 'ContextObj' object has no attribute 'msg'
Any idea on what could be causing this odd behavior?
--
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.