

def _comparison(self, op, value):
    "Internal helper for comparison operators.\n\n    Args:\n      op: The operator ('=', '<' etc.).\n\n    Returns:\n      A FilterNode instance representing the requested comparison.\n    "
    if (not self._indexed):
        raise datastore_errors.BadFilterError(('Cannot query for unindexed property %s' % self._name))
    from .query import FilterNode
    if (value is not None):
        value = self._do_validate(value)
        value = self._call_to_base_type(value)
        value = self._datastore_type(value)
    return FilterNode(self._name, op, value)

dataset/ETHPy150Open GoogleCloudPlatform/datastore-ndb-python/ndb/model.py Property._comparison/original