According to PEP 318, the syntax for function decorators is:
@dec2 @dec1 def func(arg1, arg2, ...): pass
this is equivalent to:
def func(arg1, arg2, ...): pass func = dec2(dec1(func))
and dec1 is called before dec2.
You can define these functions this way:
def dec1(func): print 'dec1' def dec2(func): print 'dec2' @dec2 @dec1 def func(): pass dec1 dec2
This does not actually make any mistake, but if you use login_reqired and the user has not registered in the application, he will process the data and paginate it after that. login_required function generates an interrupt
Best implementation for login_required decoder in bulb:
@paginate @login_required def view_function(): pass
source share