Package django :: Package contrib :: Package auth :: Module decorators :: Class _CheckLogin
[hide private]
[frames] | no frames]

Class _CheckLogin

source code

object --+
         |
        _CheckLogin

Class that checks that the user passes the given test, redirecting to the log-in page if necessary. If the test is passed, the view function is invoked. The test should be a callable that takes the user object and returns True if the user passes.

We use a class here so that we can define __get__. This way, when a _CheckLogin object is used as a method decorator, the view function is properly bound to its instance.

Instance Methods [hide private]
 
__init__(self, view_func, test_func, login_url=None, redirect_field_name='next')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__get__(self, obj, cls=None) source code
 
__call__(self, request, *args, **kwargs) source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, view_func, test_func, login_url=None, redirect_field_name='next')
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)