def _get_relationship(self, name, direction):
        """Get relationship metadata related to a given property."""
        rel = getattr(type(self), name)
        if rel.prop.direction.name != direction:
            raise TypeError("Not a %s relationship!" % direction)
        if not issubclass(rel.mapper.class_, SchemaModel):
            raise TypeError("Associated class is not a SchemaModel!")
        return rel
dataset/ETHPy150Open pudo/aleph/aleph/model/schema_model.py/SchemaModel._get_relationship/original