def get_domain(self, id=None, **dico): if id: dico['id'] = id if 'name' in dico: dico['name'] = dico['name'].lower() domains = self.list_domains_info(name=dico.get('name', None), limit=1) for domain in domains: if is_subdict(dico, domain): return Domain(self, **domain) raise UnknownDomain("Not found")
def get_record(self, id=None, **dico): if id: dico['id'] = id if 'name' in dico: dico['name'] = dico['name'].lower() records = self.list_records_info() for record in records: if is_subdict(dico, record): return Record(self, **record) #TODO: raise Exception("Not found")