Lints.
This commit is contained in:
parent
1433f28846
commit
f37bad0e00
260 changed files with 6363 additions and 3766 deletions
|
|
@ -10,6 +10,7 @@ from .comparisons import get_comparison_func
|
|||
|
||||
|
||||
class DynamoJsonEncoder(json.JSONEncoder):
|
||||
|
||||
def default(self, obj):
|
||||
if hasattr(obj, 'to_json'):
|
||||
return obj.to_json()
|
||||
|
|
@ -53,6 +54,7 @@ class DynamoType(object):
|
|||
|
||||
|
||||
class Item(object):
|
||||
|
||||
def __init__(self, hash_key, hash_key_type, range_key, range_key_type, attrs):
|
||||
self.hash_key = hash_key
|
||||
self.hash_key_type = hash_key_type
|
||||
|
|
@ -157,7 +159,8 @@ class Table(object):
|
|||
else:
|
||||
range_value = None
|
||||
|
||||
item = Item(hash_value, self.hash_key_type, range_value, self.range_key_type, item_attrs)
|
||||
item = Item(hash_value, self.hash_key_type, range_value,
|
||||
self.range_key_type, item_attrs)
|
||||
|
||||
if range_value:
|
||||
self.items[hash_value][range_value] = item
|
||||
|
|
@ -167,7 +170,8 @@ class Table(object):
|
|||
|
||||
def get_item(self, hash_key, range_key):
|
||||
if self.has_range_key and not range_key:
|
||||
raise ValueError("Table has a range key, but no range key was passed into get_item")
|
||||
raise ValueError(
|
||||
"Table has a range key, but no range key was passed into get_item")
|
||||
try:
|
||||
if range_key:
|
||||
return self.items[hash_key][range_key]
|
||||
|
|
@ -222,7 +226,8 @@ class Table(object):
|
|||
# Comparison is NULL and we don't have the attribute
|
||||
continue
|
||||
else:
|
||||
# No attribute found and comparison is no NULL. This item fails
|
||||
# No attribute found and comparison is no NULL. This item
|
||||
# fails
|
||||
passes_all_conditions = False
|
||||
break
|
||||
|
||||
|
|
@ -283,7 +288,8 @@ class DynamoDBBackend(BaseBackend):
|
|||
return None, None
|
||||
|
||||
hash_key = DynamoType(hash_key_dict)
|
||||
range_values = [DynamoType(range_value) for range_value in range_value_dicts]
|
||||
range_values = [DynamoType(range_value)
|
||||
for range_value in range_value_dicts]
|
||||
|
||||
return table.query(hash_key, range_comparison, range_values)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue