我尝试使用python脚本将$where = array(
'username' => $this->session->userdata('username'),
'reservation_status' => 1,
'reservation_date' => $desired_date,
);
$query = $this->db->select('*')->from('courtone_reservation')->where($where)->get();
项目放入Amazon DynamoDB表中,但是当我运行python脚本时出现以下错误:
put
我的代码是:
Traceback (most recent call last):
File "./table.py", line 32, in <module>
item.put(None, None)
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb/item.py", line 183, in put
return self.table.layer2.put_item(self, expected_value, return_values)
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb/layer2.py", line 551, in put_item
object_hook=self.dynamizer.decode)
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb/layer1.py", line 384, in put_item
object_hook=object_hook)
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb/layer1.py", line 119, in make_request
retry_handler=self._retry_handler)
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 954, in _mexe
status = retry_handler(response, i, next_sleep)
File "/usr/local/lib/python2.7/dist-packages/boto/dynamodb/layer1.py", line 159, in _retry_handler
data)
boto.exception.DynamoDBResponseError: DynamoDBResponseError: 400 Bad Request
{u'message': u'Requested resource not found', u'__type': u'com.amazonaws.dynamodb.v20111205#ResourceNotFoundException'}
我的参考是:Setting/Getting/Deleting CORS Configuration on a Bucket
答案 0 :(得分:0)
我在我的帐户中运行了您的代码,它100%完美,返回:
{u'ConsumedCapacityUnits': 1.0}
您可能想要检查您使用的是最新版本的boto
:
pip install boto --upgrade
答案 1 :(得分:0)
我在谷歌搜索并解决了我的问题。我在我的覆盆子pi板上设置了正确的时间和日期并运行该程序,它运行正常。