diff --git a/README.md b/README.md index 43a8645c..bd1308e4 100644 --- a/README.md +++ b/README.md @@ -91,12 +91,12 @@ rec_position = client.record_create( cluster_id, rec ) ```python rec3 = { '@my_class': { 'accommodation': 'hotel', 'work': 'home', 'holiday': 'hills' } } -update_success = client.record_update( rec_position.rid, rec_position.rid, rec3, rec_position.version ) +update_success = client.record_update( rec_position._rid, rec_position._rid, rec3, rec_position._version ) ``` ### Load a record ```python -client.record_load( rec_position.rid ) +client.record_load( rec_position._rid ) ``` ### Load a record with cache @@ -104,7 +104,7 @@ client.record_load( rec_position.rid ) def _my_callback(for_every_record): print(for_every_record) -client.record_load( rec_position.rid, "*:-1", _my_callback ) +client.record_load( rec_position._rid, "*:-1", _my_callback ) ``` ### Make a query @@ -122,7 +122,7 @@ result = client.query_async("select from my_class", 10, '*:0', _my_callback) ### Delete a record ```python -client.record_delete( cluster_id, rec_position.rid ) +client.record_delete( cluster_id, rec_position._rid ) ``` ### Drop a DB @@ -180,7 +180,7 @@ rec_position1 = client.record_create( -1, rec1 ) # prepare for an update rec2 = { 'accommodation': 'hotel', 'work': 'office', 'holiday': 'mountain' } -update_record = client.record_update( cluster_id, rec_position.rid, rec2, rec_position.version ) +update_record = client.record_update( cluster_id, rec_position._rid, rec2, rec_position._version ) tx.attach( rec_position1 ) tx.attach( rec_position1 ) diff --git a/pyorient/constants.py b/pyorient/constants.py index ad4a1264..6da6b5b4 100644 --- a/pyorient/constants.py +++ b/pyorient/constants.py @@ -4,7 +4,7 @@ # Driver Constants # NAME = "OrientDB Python binary client (pyorient)" -VERSION = "1.3.1" +VERSION = "1.4" SUPPORTED_PROTOCOL = 28 # diff --git a/setup.py b/setup.py index 8179d479..a76caac1 100755 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ from setuptools import setup setup(name='pyorient', - version='1.3.1', + version='1.4', author='Niko Usai , Domenico Lupinetti ', description='OrientDB native client library', long_description=open('README.md').read(), diff --git a/test/test_reserved_words_batch.py b/test/test_reserved_words_batch.py index ea99d86b..05171475 100644 --- a/test/test_reserved_words_batch.py +++ b/test/test_reserved_words_batch.py @@ -83,10 +83,15 @@ def test_reserved_words(self): assert x[0].ciao == 1234 x = self.client.command("select rid, @rid, model, ciao from V") + import re + assert re.match( '#[-]*[0-9]+:[0-9]+', x[0]._rid ), ( + "Failed to assert that " + "'#[-]*[0-9]+:[0-9]+' matches received " + "value: '%s'" % x[0]._rid + ) + print( x[0]._rid ) - assert x[0]._rid == '#-2:0' assert x[0].rid == 'test_rid' - assert x[0].rid2.get_hash() == '#9:0' try: x[0]._rid.get_hash() assert False @@ -99,6 +104,15 @@ def test_reserved_words(self): assert x[0].model == '1123' assert x[0].ciao == 1234 + def test_new_projection(self): + rec = {'@Package': {'name': 'foo', 'version': '1.0.0'}} + x = self.client.record_create(9, rec) + assert x._rid == '#9:0' + assert x._version == 1 + assert x._class == 'Package' + assert x.name == 'foo' + assert x.version == '1.0.0' + def test_sql_batch(self): cmd = "begin;" + \ "let a = create vertex set script = true;" + \