forked from pynamodb/PynamoDB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage.py
35 lines (29 loc) · 1.11 KB
/
page.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from pynamodb.models import Model
from pynamodb.attributes import (
UnicodeAttribute, UnicodeSetAttribute, Attribute, LegacyBooleanAttribute, BooleanAttribute, NumberAttribute, BinaryAttribute,MapAttribute, ListAttribute)
from pynamodb.indexes import GlobalSecondaryIndex, AllProjection
import json
from six import *
from pynamodb.models import Model
from pynamodb.indexes import GlobalSecondaryIndex, AllProjection
from pynamodb.attributes import NumberAttribute, UnicodeAttribute, MapAttribute, MapAttributeMeta, AttributeContainer
from pynamodb.constants import (
STRING, STRING_SHORT, NUMBER, ATTR_TYPE_MAP
)
from pynamodb.expressions.operand import Path
import copy
class MyModel(Model):
class Meta:
table_name = "anand-test-consumed"
host="dynamodb-server.devbox.lyft.net:8000"
id = UnicodeAttribute(hash_key=True)
name = UnicodeAttribute(null=True)
if MyModel.exists():
MyModel.delete_table()
MyModel.create_table(read_capacity_units=2, write_capacity_units=2)
for i in range(1,100):
m = MyModel(i)
m.name = str(i)
m.save()
for x in MyModel.scan(limit=10):
print (x)