Created
May 7, 2014 15:49
-
-
Save jlafon/28b0ae2e50435dbd5e13 to your computer and use it in GitHub Desktop.
Issue 20
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
from __future__ import print_function | |
import logging | |
from pynamodb.models import Model | |
from pynamodb.attributes import (UnicodeAttribute) | |
logging.basicConfig() | |
log = logging.getLogger("") | |
log.setLevel(logging.DEBUG) | |
log.propagate = True | |
class TestModel(Model): | |
class Meta: | |
host = 'http://localhost:8000' | |
region = 'us-east-1' | |
table_name = 'pynamo-test-table' | |
table_key = UnicodeAttribute(hash_key=True) | |
table_string_field = UnicodeAttribute(default='') | |
if __name__ == "__main__": | |
if not TestModel.exists(): | |
TestModel.create_table(read_capacity_units=2, write_capacity_units=1, | |
wait=True) | |
result = TestModel.get('Nonexistent') | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment