我正试图在示例here(位于^{cd2>}下的# The full, minimum-extra-calls case.
块)之后创建一个具有全局辅助索引的DynamoDB表。我使用的是boto
版本2.25.0。确切的代码是:
import boto
from boto import dynamodb2
table = boto.dynamodb2.table.Table('myTable',
schema=[HashKey('firstKey')],
throughput={'read':5,'write':2},
global_indexes=[GlobalAllIndex('secondKeyIndex',parts=[HashKey('secondKey')],throughput={'read':5,'write':3})],
connection=dynamodb2.connect_to_region('us-east-1',aws_access_key_id=<MYID>,aws_secret_access_key=<MYKEY>))
我得到了AttributeError: 'module' object has no attribute 'table'
我做错什么了?在
======
编辑:根据贾罗德下面的回答,以下是代码的最终版本:
^{pr2}$
尝试以这种方式导入:
我已经在botocore上编写了一个库,它也可以做到这一点:PynamoDB。在
相关问题 更多 >
编程相关推荐