Working on persistence api

This commit is contained in:
Gert Wohlgemuth
2018-05-19 17:07:32 -07:00
parent 2da14fc554
commit 92d3afd6e8
4 changed files with 79 additions and 12 deletions

View File

@@ -2,6 +2,7 @@ import boto3
import simplejson as json
import decimal
class DecimalEncoder(json.JSONEncoder):
def default(self, o):
if isinstance(o, decimal.Decimal):
@@ -30,16 +31,15 @@ class Persistence:
table = self.db.Table(self.table)
response = table.scan()
result = []
result = response['Items']
while 'LastEvaluatedKey' in response:
for i in response['Items']:
result.append(i)
response = table.scan(
ExclusiveStartKey=response['LastEvaluatedKey']
)
for i in response['Items']:
result.append(i)
return result
def load(self, sample):