Module Expr Str ImportFrom alias Import alias Import alias ImportFrom alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias identifier ImportFrom alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Lambda arguments args defaults vararg Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad FunctionDef arguments args defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Dict AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad If Call NameLoad NameLoad Call NameLoad body Return TupleLoad NameLoad NameLoad orelse If Call NameLoad NameLoad NameLoad body Return TupleLoad NameLoad NameLoad Raise Call NameLoad BinOpMod Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad body Assign NameStore BoolOpOr NameLoad AttributeLoad NameLoad attr Assign NameStore BoolOpOr NameLoad NameLoad Assign NameStore NameLoad If NameLoad body Assign NameStore Call NameLoad GeneratorExp Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad comprehension NameStore NameLoad If UnaryOpNot NameLoad body Assign NameStore Call NameLoad GeneratorExp Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad comprehension NameStore NameLoad If UnaryOpNot NameLoad body If NameLoad body If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Dict Call NameLoad NameLoad Assign AttributeStore NameLoad attr Num Return NameLoad orelse If AttributeLoad NameLoad attr body Raise NameLoad Return Call NameLoad orelse Return Call NameLoad Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args defaults body Expr Str ImportFrom alias ImportFrom alias Assign NameStore Num For NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr body If CompareIs AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr BinOpMod Str TupleLoad NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AugAssignAdd NameStore Num Expr Call AttributeLoad NameLoad attr BinOpMod Str NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If Call NameLoad NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareGtE AttributeLoad NameLoad attr TupleLoad Num Num body Assign NameStore GeneratorExp NameLoad comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr BoolOpAnd BoolOpOr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr For NameStore NameLoad body If CompareLt AttributeLoad NameLoad attr TupleLoad Num Num body Assign NameStore Call NameLoad NameLoad Str NameLoad orelse Assign NameStore Call NameLoad NameLoad Str NameLoad If BoolOpAnd NameLoad Call NameLoad NameLoad NameLoad CompareIsNot NameLoad NameLoad body If UnaryOpNot Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If CompareEq NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str ImportFrom alias ImportFrom alias Return Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str ImportFrom alias ImportFrom alias Return Call NameLoad NameLoad NameLoad NameLoad decorator_list
N/A N/A 
django-guardian helper functions.

Functions defined within this module should be considered as django-guardian's
internal functionality. They are **not** guaranteed to be stable - which means
they actual input parameters/output type may change in future releases.
 __future__ unicode_literals N/A os N/A logging itertools chain N/A django django.conf settings django.contrib.auth REDIRECT_FIELD_NAME django.contrib.auth.models AnonymousUser Group django.contrib.contenttypes.models ContentType django.core.exceptions PermissionDenied django.db.models Model django.http HttpResponseForbidden django.shortcuts render_to_response django.template RequestContext TemplateDoesNotExist guardian.compat get_user_model guardian.conf settings guardian_settings guardian.exceptions NotUserNorGroup django.contrib.auth.views redirect_to_login N/A logger N/A N/A logging getLogger __name__ N/A abspath N/A N/A N/A N/A p N/A N/A N/A os path abspath N/A N/A N/A os path join p get_anonymous_user N/A N/A N/A N/A N/A 
    Returns ``User`` instance (not ``AnonymousUser``) depending on
    ``ANONYMOUS_USER_NAME`` configuration.
     N/A User N/A get_user_model N/A lookup N/A N/A User USERNAME_FIELD N/A guardian_settings ANONYMOUS_USER_NAME N/A N/A N/A N/A User objects get lookup N/A get_identity N/A N/A identity N/A N/A N/A 
    Returns (user_obj, None) or (None, group_obj) tuple depending on what is
    given. Also accepts AnonymousUser instance but would return ``User``
    instead - it is convenient and needed for authorization backend to support
    anonymous users.

    :param identity: either ``User`` or ``Group`` instance

    :raises ``NotUserNorGroup``: if cannot return proper identity instance

    **Examples**::

       >>> from django.contrib.auth.models import User
       >>> user = User.objects.create(username='joe')
       >>> get_identity(user)
       (<User: joe>, None)

       >>> group = Group.objects.create(name='users')
       >>> get_identity(group)
       (None, <Group: users>)

       >>> anon = AnonymousUser()
       >>> get_identity(anon)
       (<User: AnonymousUser>, None)

       >>> get_identity("not instance")
       ...
       NotUserNorGroup: User/AnonymousUser or Group instance is required (got )

     N/A N/A isinstance identity AnonymousUser N/A N/A identity N/A get_anonymous_user N/A N/A isinstance identity N/A get_user_model N/A N/A N/A identity None N/A N/A N/A isinstance identity Group N/A N/A N/A None identity N/A N/A NotUserNorGroup N/A User/AnonymousUser or Group instance is required (got %s) identity N/A get_403_or_None N/A N/A request perms obj login_url redirect_field_name return_403 accept_global_perms N/A None None None False False N/A N/A login_url N/A login_url N/A settings LOGIN_URL N/A redirect_field_name N/A redirect_field_name REDIRECT_FIELD_NAME N/A has_permissions False N/A accept_global_perms N/A N/A has_permissions N/A all N/A N/A N/A N/A request user has_perm perm N/A perm perms N/A N/A has_permissions N/A N/A has_permissions N/A all N/A N/A N/A N/A request user has_perm perm obj N/A perm perms N/A N/A has_permissions N/A N/A return_403 N/A N/A N/A guardian_settings RENDER_403 N/A N/A response N/A render_to_response N/A guardian_settings TEMPLATE_403 N/A N/A RequestContext request N/A N/A response status_code 403 N/A response N/A N/A N/A guardian_settings RAISE_403 N/A N/A PermissionDenied N/A N/A HttpResponseForbidden N/A N/A N/A redirect_to_login N/A N/A request get_full_path login_url redirect_field_name N/A clean_orphan_obj_perms N/A N/A N/A N/A N/A 
    Seeks and removes all object permissions entries pointing at non-existing
    targets.

    Returns number of removed objects.
     guardian.models UserObjectPermission guardian.models GroupObjectPermission N/A deleted 0 N/A perm N/A chain N/A N/A N/A UserObjectPermission objects all N/A N/A N/A GroupObjectPermission objects all N/A N/A N/A N/A perm content_object None N/A N/A N/A N/A logger debug N/A Removing %s (pk=%d) N/A perm N/A perm pk N/A N/A N/A perm delete N/A deleted 1 N/A N/A N/A logger info N/A Total removed orphan object permissions instances: %d deleted N/A deleted N/A get_obj_perms_model N/A N/A obj base_cls generic_cls N/A N/A N/A N/A isinstance obj Model N/A N/A obj N/A obj __class__ N/A ctype N/A N/A N/A ContentType objects get_for_model obj N/A N/A N/A django VERSION N/A 1 8 N/A N/A fields N/A f N/A f N/A N/A N/A obj _meta get_fields N/A N/A N/A f one_to_many N/A f one_to_one N/A f auto_created N/A N/A fields N/A N/A N/A obj _meta get_all_related_objects N/A attr fields N/A N/A N/A N/A django VERSION N/A 1 8 N/A N/A model N/A getattr attr model None N/A N/A model N/A getattr attr related_model None N/A N/A model N/A issubclass model base_cls N/A model generic_cls N/A N/A N/A N/A N/A N/A model objects is_generic N/A N/A fk N/A N/A N/A model _meta get_field content_object N/A N/A ctype N/A N/A N/A ContentType objects get_for_model N/A N/A fk rel to N/A N/A model N/A generic_cls N/A get_user_obj_perms_model N/A N/A obj N/A N/A N/A 
    Returns model class that connects given ``obj`` and User class.
     guardian.models UserObjectPermissionBase guardian.models UserObjectPermission N/A N/A get_obj_perms_model obj UserObjectPermissionBase UserObjectPermission N/A get_group_obj_perms_model N/A N/A obj N/A N/A N/A 
    Returns model class that connects given ``obj`` and Group class.
     guardian.models GroupObjectPermissionBase guardian.models GroupObjectPermission N/A N/A get_obj_perms_model obj GroupObjectPermissionBase GroupObjectPermission N/A