[Chicago] CherryPy decorators question
lists at durin42.com
Fri Feb 27 18:19:29 CET 2009
On Feb 27, 2009, at 10:35 AM, Daniel Griffin wrote:
> I am a bit confused about decorators in cherrypy and was hoping
> someone could help me. I am trying to add a decorator to some pages
> to deal with security stuff but when I add them I break the
> decorators that expose the methods. I think im doing something wrong
> def auth(func):
> print "some stuff"
Your decorator needs to return a callable - in this case, probably func.
> class .....
> def index(self):
> return some template
> index.exposed = True
> Python complains that one or the other is broken and im pretty
> confused about why there seems to be 2 different syntaxes.
> Chicago mailing list
> Chicago at python.org
More information about the Chicago