#NEWLINE# def get_permission_owners_of_type_for_object( permission , owner_content_type , content_object ) : #NEWLINE# #INDENT# OwnerToPermission = apps . get_model ( 'protector' , 'OwnerToPermission' ) #NEWLINE# qs = OwnerToPermission . objects . filter ( content_type = ContentType . objects . get_for_model ( content_object . _meta . model ) , object_id = content_object . pk , owner_content_type = owner_content_type , permission = permission ) #NEWLINE# return owner_content_type . model_class ( ) . objects . filter ( id__in = qs . values_list ( 'owner_object_id' , flat = True ) )