def __contains__(self, perm_name):
        """
        Lookup by "someapp" or "someapp.someperm" in perms.
        """
        if "." not in perm_name:
            return perm_name in self.apps

        else:
            module_name, perm_name = perm_name.split(".", 1)
            if module_name in self.apps:
                return perm_name in self.apps[module_name]
            else:
                return False
def __contains__ ( self , perm_name ) : if "." not in perm_name : return perm_name in self . apps else : module_name , perm_name = perm_name . split ( "." , 1 ) if module_name in self . apps : return perm_name in self . apps [ module_name ] else : return False
Lookup by "someapp" or "someapp.someperm" in perms.