Package wtf :: Package app :: Module decorators :: Class RequestDecorator
[hide private]
[frames] | no frames]

Class RequestDecorator

source code

        object --+    
                 |    
util.BaseDecorator --+
                     |
                    RequestDecorator

General purpose base request decorator

Implement the decorate method in order to add the action. If the response is finised before calling the decorated function, raise response.Done.

Instance Methods [hide private]
any
__call__(self, *args, **kwargs)
Request handler -> overwrite decorate instead
source code
any
decorate(self, request, response, args, kwargs)
Decorating action has to be implemented here.
source code

Inherited from util.BaseDecorator: __get__, __getattr__, __init__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]

Inherited from util.BaseDecorator: __doc__, __name__

Inherited from util.BaseDecorator (private): _func

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__call__(self, *args, **kwargs)
(Call operator)

source code 
Request handler -> overwrite decorate instead
Parameters:
  • args - Positioned parameters
  • kwargs - named parameters
Returns: any
The return value of the decorated function (maybe modified or replaced by the decorator)
Overrides: util.BaseDecorator.__call__

decorate(self, request, response, args, kwargs)

source code 
Decorating action has to be implemented here.
Parameters:
Returns: any
The return value of the decorated function (maybe modified or replaced by the decoator)