> > To take advantage of the decorators at a file level, you can also do this > at the top level of a file: > > auth.requires_login()(lambda: None)() > > The decorators ultimately call auth.requires, which itself returns a > decorator. The above passes a dummy function to that decorator and then > simply calls it. Note, you don't prepend with "@" in this case, as you are > not decorating a Python function. > > I think that's brilliant... but I don't quite understand. Without the decorators how to the functions in the file get forced to go through auth.requires_login()?
-- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.