Support update_item with map and numeric types.

This commit is contained in:
Paul Craciunoiu 2015-12-21 16:45:08 -07:00
commit f1099dd006
2 changed files with 14 additions and 1 deletions

View file

@ -129,6 +129,10 @@ class Item(object):
# TODO deal with other types
if isinstance(new_value, list) or isinstance(new_value, set):
self.attrs[attribute_name] = DynamoType({"SS": new_value})
elif isinstance(new_value, dict):
self.attrs[attribute_name] = DynamoType({"M": new_value})
elif update_action['Value'].keys() == ['N']:
self.attrs[attribute_name] = DynamoType({"N": new_value})
else:
self.attrs[attribute_name] = DynamoType({"S": new_value})