Python3 fixes for dynamodb2.

This commit is contained in:
Steve Pulec 2014-10-26 21:11:03 -04:00
parent 56ee4fa555
commit 4bfbf3bbf3

View File

@ -31,8 +31,8 @@ class DynamoType(object):
""" """
def __init__(self, type_as_dict): def __init__(self, type_as_dict):
self.type = type_as_dict.keys()[0] self.type = list(type_as_dict)[0]
self.value = type_as_dict.values()[0] self.value = list(type_as_dict.values())[0]
def __hash__(self): def __hash__(self):
return hash((self.type, self.value)) return hash((self.type, self.value))
@ -173,6 +173,9 @@ class Table(object):
def __nonzero__(self): def __nonzero__(self):
return True return True
def __bool__(self):
return self.__nonzero__()
@property @property
def has_range_key(self): def has_range_key(self):
return self.range_key_attr is not None return self.range_key_attr is not None