Skip to content

Instantly share code, notes, and snippets.

@maracuja
Created September 7, 2018 14:36
Show Gist options
  • Save maracuja/95b69ed39ee8b0387d2a8afa6cb0b41c to your computer and use it in GitHub Desktop.
Save maracuja/95b69ed39ee8b0387d2a8afa6cb0b41c to your computer and use it in GitHub Desktop.
Dynamo DB Test
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