If I have a controller file as below I find that the decorator() function is called when any controller in the file is called not just the decorated ones. i.e. If I access /application/default/index I see "decorator called" as well as when I access /application/default/ index2. Am I doing something stupid? Thanks, chris.
def decorator(func): print("decorator called") return func def index(): response.flash=T('Welcome to web2py') return dict(message=T('Hello World 1')) @decorator def index2(): response.flash=T('Welcome to web2py') return dict(message=T('Hello World 2')) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py Web Framework" group. To post to this group, send email to web2py@googlegroups.com To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---