Created
September 7, 2018 14:36
-
-
Save maracuja/95b69ed39ee8b0387d2a8afa6cb0b41c to your computer and use it in GitHub Desktop.
Dynamo DB Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
db = boto3.resource( | |
'dynamodb', | |
region_name='', | |
) | |
table = db.Table('table_name') | |
sample_la = '123123123' | |
la = Model.objects.get(refnum=sample_la) | |
from snapshot import helpers | |
ss = helpers.get_snapshot(la) | |
from bson import json_util as json | |
ss = json.dumps(ss) | |
table.put_item( | |
Item={ | |
'refnum': sample_la, | |
'version': 'latest', | |
'data': ss, | |
} | |
) | |
table.get_item(Key={'refnum': sample_la}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment