Skip to content

Commit

Permalink
Upgraded Version to 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Ostico committed Mar 21, 2015
1 parent 2b14fd3 commit 83cbad2
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,20 +91,20 @@ 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
```python
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
Expand All @@ -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
Expand Down Expand Up @@ -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 )
Expand Down
2 changes: 1 addition & 1 deletion pyorient/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Driver Constants
#
NAME = "OrientDB Python binary client (pyorient)"
VERSION = "1.3.1"
VERSION = "1.4"
SUPPORTED_PROTOCOL = 28

#
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from setuptools import setup

setup(name='pyorient',
version='1.3.1',
version='1.4',
author='Niko Usai <[email protected]>, Domenico Lupinetti <[email protected]>',
description='OrientDB native client library',
long_description=open('README.md').read(),
Expand Down
18 changes: 16 additions & 2 deletions test/test_reserved_words_batch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;" + \
Expand Down

0 comments on commit 83cbad2

Please sign in to comment.