def get_type(e_id): entity = Entity(self._db) try: entity.find(e_id) return six.text_type(co.EntityType(entity.entity_type)) except Cerebrum.Errors.NotFoundError: return None
def get_owner(self): """Return the owner object of the proper type.""" ent = Entity(self._db) ent.find(self.owner_entity_id) if ent.entity_type == self.const.entity_voip_service: result = VoipService(self._db) result.find(self.owner_entity_id) return result ent.clear() return ent.get_subclassed_object(self.owner_entity_id)