On 6 jul, 18:16, mdipierro <[email protected]> wrote:
> Not sure I understand. You need only one
>
> > def user ():
> > return dict(form=auth())
>
> If you need to decorate lots of functions with @auth.requires_login(),
> you can do
>
> if not request.function in ['index','other_allowed_function'] and not
> auth.is_logged_in():
> redirect(URL(r=request,f='user/login'))
>
I refer to that if I define:
def user ():
return dict(form=auth())
in default.py, I can decorate only the functions of default.py. If I
need to decorate a function in another_controller.py, I cannot do it.
I must define again:
def user ():
return dict(form=auth())
in another_controller.py
Jose
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" 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/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---