Exemplo n.º 1
0
    def create_domain(self, context, values):
        domain = models.Domain()

        domain.update(values)

        try:
            domain.save(self.session)
        except exceptions.Duplicate:
            raise exceptions.DuplicateDomain()

        return dict(domain)
Exemplo n.º 2
0
    def create_domain(self, context, domain):
        storage_domain = models.Domain()

        storage_domain.update(domain)

        try:
            storage_domain.save(self.session)
        except exceptions.Duplicate:
            raise exceptions.DuplicateDomain()

        return objects.Domain.from_sqla(storage_domain)