You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when insert a record to database i got "'NoneType' object is not callable"
`
import tornado.web
from tornado.gen import coroutine
from tornado_sqlalchemy import as_future
from database.tables import *
class UploadFileHandler(BaseHandler):
@coroutine
def post(self):
_file = self.request.files['upload'][0]
_filename = _file["filename"].split(".")[0]
_extension = _file["filename"].split(".")[1]
_mobile = '12345678901'
upload_file = UploadFile(mobile=_mobile,
body=_file['body'],
filename=_filename,
extension=_extension)
with self.make_session() as session:
session.add(upload_file)
yield as_future(session.commit())
`
and the error log is
File "/usr/local/lib/python3.5/dist-packages/tornado/web.py", line 1592, in _execute
result = yield result
File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/srv/www/api/upload_file.py", line 20, in post
yield as_future(session.commit())
File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable
The text was updated successfully, but these errors were encountered:
when insert a record to database i got "'NoneType' object is not callable"
`
import tornado.web
from tornado.gen import coroutine
from tornado_sqlalchemy import as_future
from database.tables import *
class UploadFileHandler(BaseHandler):
@coroutine
def post(self):
_file = self.request.files['upload'][0]
_filename = _file["filename"].split(".")[0]
_extension = _file["filename"].split(".")[1]
_mobile = '12345678901'
upload_file = UploadFile(mobile=_mobile,
body=_file['body'],
filename=_filename,
extension=_extension)
with self.make_session() as session:
session.add(upload_file)
yield as_future(session.commit())
`
and the error log is
File "/usr/local/lib/python3.5/dist-packages/tornado/web.py", line 1592, in _execute
result = yield result
File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/srv/www/api/upload_file.py", line 20, in post
yield as_future(session.commit())
File "/usr/local/lib/python3.5/dist-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
TypeError: 'NoneType' object is not callable
The text was updated successfully, but these errors were encountered: