Hello
I am experiencing an issue with the example you have given:
Here is adapted my code
import json
import bottle
import bottle_cassandra_driver
from bottle import request, response, get, post, put, delete
app = application = bottle.Bottle()
application = bottle.default_app()
bottle_host='127.0.0.1'
bottle_port=80
cql_plugin = bottle_cassandra_driver.CassandraPlugin(endpoints=['127.0.0.1'], keyspace='fitness')
bottle.install(cql_plugin)
@get(['/'])
def route_index(cqlconnection):
rows = cqlconnection.execute("SELECT * FROM calibration")
output = []
for r in rows:
output.append(str(r.rfid))
return bottle.HTTPResponse(status=200, body=json.dumps(output))
bottle.run(host=bottle_host, port=bottle_port, reloader=bottle.DEBUG)
And once I make the request using postman I receive the following:
File "C:\Users\owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bottle.py", line 997, in _handle
out = route.call(**args)
File "C:\Users\owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bottle.py", line 245, in get
value = obj.dict[self.func.name] = self.func(obj)
File "C:\Users\owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bottle.py", line 545, in call
return self._make_callback()
File "C:\Users\owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bottle.py", line 572, in _make_callback
callback = plugin.apply(callback, self)
File "C:\Users\owner\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bottle_cassandra_driver-0.0.2-py3.6.egg\bottle_cassandra_driver.py", line 84, in apply
args = inspect.getargspec(context['callback'])[0]
TypeError: 'Route' object is not subscriptable
Hello
I am experiencing an issue with the example you have given:
Here is adapted my code
import json
import bottle
import bottle_cassandra_driver
from bottle import request, response, get, post, put, delete
app = application = bottle.Bottle()
application = bottle.default_app()
bottle_host='127.0.0.1'
bottle_port=80
cql_plugin = bottle_cassandra_driver.CassandraPlugin(endpoints=['127.0.0.1'], keyspace='fitness')
bottle.install(cql_plugin)
@get(['/'])
def route_index(cqlconnection):
rows = cqlconnection.execute("SELECT * FROM calibration")
output = []
for r in rows:
output.append(str(r.rfid))
return bottle.HTTPResponse(status=200, body=json.dumps(output))
bottle.run(host=bottle_host, port=bottle_port, reloader=bottle.DEBUG)
And once I make the request using postman I receive the following: