How to use the neo4j._backend.strings function in neo4j

To help you get started, we’ve selected a few neo4j examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github neo4j / neo4j / python-embedded / src / main / python / neo4j / model.py View on Github external
def query(self, key, value, lookup, filters):
        if '__' in key:
            key, op = key.split('__',1)
        else:
            op = 'eq'
        if self.__index:
            if op == 'eq':
                op = ':'
            else:
                raise TypeError("Unsupported query operator '%s'" % op)
            if isinstance(value, strings):
                value = '"%s"' % value # TODO: we might need escaping
            lookup.append("%s%s%s" % (self.__index_key,op,value))
        else:
            if op == 'eq':
                predicate = lambda entity: self.get(entity[key]) == value
            else:
                raise TypeError("Unsupported query operator '%s'" % op)
            filters.append(predicate)
github neo4j / neo4j / python-embedded / src / main / python / neo4j / model.py View on Github external
def property_type(type):
    if type is None: return DynamicProperty
    if issubclass(type, strings): return StringProperty
    if type in integers: return NumberProperty
    if type is float: return NumberProperty
    if type is datetime.datetime: return DateProperty
github neo4j / neo4j / python-embedded / src / main / python / neo4j / model.py View on Github external
def set(self, value):
        if isinstance(value, strings): return value
        if isinstance(value, integers): return value
        if isinstance(value, float): return value
        raise ValueError("Invalid property type: '%s'" % type(value).__name__)