(cls, backend_type, domain, count_only=False, offset=None, limit=None)
return [cls.load(pk) for pk in result]
Returns all the backends that the given domain has access to (that is,
        owned backends, shared backends, and global backends).
Returns all the backends that the given domain has access to (that is,
        owned backends, shared backends, and global backends).
Returns all the backends that the given domain has access to ( that is owned backends shared backends and global backends ) .
def get_domain_backends(cls, backend_type, domain, count_only=False, offset=None, limit=None):
        """
        Returns all the backends that the given domain has access to (that is,
        owned backends, shared backends, and global backends).
        """
        domain_owned_backends = models.Q(is_global=False, domain=domain)
        domain_shared_backends = models.Q(
            is_global=False,
            mobilebackendinvitation__domain=domain,
            mobilebackendinvitation__accepted=True
        )
        global_backends = models.Q(is_global=True)

        # The left join to MobileBackendInvitation may cause there to be
        # duplicates here, so we need to call .distinct()
        result = SQLMobileBackend.objects.filter(
            (domain_owned_backends | domain_shared_backends | global_backends),
            deleted=False,
            backend_type=backend_type
        ).distinct()

        if count_only:
            return result.count()

        result = result.order_by('name').values_list('id', flat=True)
        if offset is not None and limit is not None:
            result = result[offset:offset + limit]

        return [cls.load(pk) for pk in result]
def get_domain_backends ( cls , backend_type , domain , count_only = False , offset = None , limit = None ) : domain_owned_backends = models . Q ( is_global = False , domain = domain ) domain_shared_backends = models . Q ( is_global = False , mobilebackendinvitation__domain = domain , mobilebackendinvitation__accepted = True ) global_backends = models . Q ( is_global = True ) # The left join to MobileBackendInvitation may cause there to be # duplicates here, so we need to call .distinct() result = SQLMobileBackend . objects . filter ( ( domain_owned_backends | domain_shared_backends | global_backends ) , deleted = False , backend_type = backend_type ) . distinct ( ) if count_only : return result . count ( ) result = result . order_by ( 'name' ) . values_list ( 'id' , flat = True ) if offset is not None and limit is not None : result = result [ offset : offset + limit ] return [ cls . load ( pk ) for pk in result ]