Permalink
Browse files

Merge pull request #2 from bitly/ver_0.2.4

Ver 0.2.4
  • Loading branch information...
2 parents d98b9a0 + 896f9a9 commit b47d9e71a10f42b1ab52b1a20080589201edacba @mreiferson mreiferson committed Feb 29, 2012
Showing with 22 additions and 4 deletions.
  1. +4 −0 CHANGELOG
  2. +2 −2 asyncdynamo/__init__.py
  3. +15 −1 asyncdynamo/asyncdynamo.py
  4. +1 −1 setup.py
View
@@ -1,3 +1,7 @@
+Version 0.2.4 - 2012-02-23
+ * Fix RangeKeyAttribute bug in queries
+ * Add put_item method
+
Version 0.2.3 - 2012-02-06
* Always pass error argument
View
@@ -28,5 +28,5 @@
except ImportError:
raise ImportError("boto library not installed. Install boto. https://github.com/boto/boto")
-version = "0.2.3"
-version_info = (0, 2, 3)
+version = "0.2.4"
+version_info = (0, 2, 4)
View
@@ -167,6 +167,20 @@ def batch_get_item(self, request_items, callback):
data = {'RequestItems' : request_items}
json_input = json.dumps(data)
self.make_request('BatchGetItem', json_input, callback)
+
+ def put_item(self, table_name, item, callback, expected=None, return_values=None, object_hook=None):
+ '''
+ Issues an async request to create a new item or replace an old one.
+ '''
+ data = {'TableName' : table_name,
+ 'Item' : item}
+ if expected:
+ data['Expected'] = expected
+ if return_values:
+ data['ReturnValues'] = return_values
+ json_input = json.dumps(data)
+ return self.make_request('PutItem', json_input, callback=callback,
+ object_hook=object_hook)
def query(self, table_name, hash_key_value, callback, range_key_conditions=None,
attributes_to_get=None, limit=None, consistent_read=False,
@@ -178,7 +192,7 @@ def query(self, table_name, hash_key_value, callback, range_key_conditions=None,
data = {'TableName': table_name,
'HashKeyValue': hash_key_value}
if range_key_conditions:
- data['RangeKeyConditions'] = range_key_conditions
+ data['RangeKeyCondition'] = range_key_conditions
if attributes_to_get:
data['AttributesToGet'] = attributes_to_get
if limit:
View
@@ -2,7 +2,7 @@
from distutils.core import setup
# also update version in __init__.py
-version = '0.2.3'
+version = '0.2.4'
setup(
name="asyncdynamo",

0 comments on commit b47d9e7

Please sign in to comment.