pwm/core.py
def get_domain(self, domain_name):
        """ Get the :class:`Domain <pwm.Domain>` object from a name.

        :param domain_name: The domain name to fetch the object for.
        :returns: The :class:`Domain <pwm.core.Domain>` class with this domain_name if found, else
            None.
        """
        protocol = self.database_uri.split(':', 1)[0]
        if protocol in ('https', 'http'):
            return self._get_domain_from_rest_api(domain_name)
        else:
            domain = self._get_domain_from_db(domain_name)
            if domain:
                return domain
            else:
                raise NoSuchDomainException
def get_domain(self, domain_name):
        """ Get the :class:`Domain <pwm.Domain>` object from a name.

        :param domain_name: The domain name to fetch the object for.
        :returns: The :class:`Domain <pwm.core.Domain>` class with this domain_name if found, else
            None.
        """
        protocol = self.database_uri.split(':', 1)[0]
        if protocol in ('https', 'http'):
            return self._get_domain_from_rest_api(domain_name)
        else:
            domain = self._get_domain_from_db(domain_name)
            if domain:
                return domain
            else:
                raise NoSuchDomainException
Get the :class:`Domain <pwm.Domain>` object from a name.

        :param domain_name: The domain name to fetch the object for.
        :returns: The :class:`Domain <pwm.core.Domain>` class with this domain_name if found, else
            None.