{"action":"created","issue":{"url":"https://api.github.com/repos/coleifer/sqlite-web/issues/38","repository_url":"https://api.github.com/repos/coleifer/sqlite-web","labels_url":"https://api.github.com/repos/coleifer/sqlite-web/issues/38/labels{/name}","comments_url":"https://api.github.com/repos/coleifer/sqlite-web/issues/38/comments","events_url":"https://api.github.com/repos/coleifer/sqlite-web/issues/38/events","html_url":"https://github.com/coleifer/sqlite-web/issues/38","id":298811410,"number":38,"title":"Error when exporting CSV","user":{"login":"LawnboyMax","id":22385215,"avatar_url":"https://avatars1.githubusercontent.com/u/22385215?v=4","gravatar_id":"","url":"https://api.github.com/users/LawnboyMax","html_url":"https://github.com/LawnboyMax","followers_url":"https://api.github.com/users/LawnboyMax/followers","following_url":"https://api.github.com/users/LawnboyMax/following{/other_user}","gists_url":"https://api.github.com/users/LawnboyMax/gists{/gist_id}","starred_url":"https://api.github.com/users/LawnboyMax/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LawnboyMax/subscriptions","organizations_url":"https://api.github.com/users/LawnboyMax/orgs","repos_url":"https://api.github.com/users/LawnboyMax/repos","events_url":"https://api.github.com/users/LawnboyMax/events{/privacy}","received_events_url":"https://api.github.com/users/LawnboyMax/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-21T01:32:08Z","updated_at":"2018-02-21T15:44:54Z","closed_at":"2018-02-21T15:44:54Z","author_association":"NONE","body":"### Error\r\n\r\nWhen trying to export table as JSON or CSV using the corresponding buttons in the Query section of the web interface I get the following error message:\r\n```\r\nInternal Server Error\r\n\r\nThe server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.\r\n```\r\n\r\n### Traceback\r\n```\r\n[2018-02-21 01:21:04,466] ERROR in app: Exception on /EOS_BTC_binance/query/ [POST]\r\nTraceback (most recent call last):\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/flask/app.py\", line 1982, in wsgi_app\r\n    response = self.full_dispatch_request()\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/flask/app.py\", line 1614, in full_dispatch_request\r\n    rv = self.handle_user_exception(e)\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/flask/app.py\", line 1517, in handle_user_exception\r\n    reraise(exc_type, exc_value, tb)\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/flask/_compat.py\", line 33, in reraise\r\n    raise value\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/flask/app.py\", line 1612, in full_dispatch_request\r\n    rv = self.dispatch_request()\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/flask/app.py\", line 1598, in dispatch_request\r\n    return self.view_functions[rule.endpoint](**req.view_args)\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/sqlite_web/sqlite_web.py\", line 185, in inner\r\n    return fn(table, *args, **kwargs)\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/sqlite_web/sqlite_web.py\", line 452, in table_query\r\n    return export(table, sql, 'csv')\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/sqlite_web/sqlite_web.py\", line 506, in export\r\n    dataset.freeze(query, export_format, file_obj=buf, **kwargs)\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/playhouse/dataset.py\", line 131, in freeze\r\n    exporter.export(file_obj, **kwargs)\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/playhouse/dataset.py\", line 301, in export\r\n    for row in self.query.tuples():\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/peewee.py\", line 1533, in __iter__\r\n    self._ensure_execution()\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/peewee.py\", line 1530, in _ensure_execution\r\n    self.execute()\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/peewee.py\", line 1447, in inner\r\n    return method(self, database, *args, **kwargs)\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/peewee.py\", line 1518, in execute\r\n    return self._execute(database)\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/peewee.py\", line 1571, in _execute\r\n    self._cursor_wrapper = self._get_cursor_wrapper(cursor)\r\n  File \"/home/ubuntu/.local/lib/python3.5/site-packages/peewee.py\", line 5409, in _get_cursor_wrapper\r\n    return ModelTupleCursorWrapper(cursor, self.model, self._returning)\r\nAttributeError: 'ModelRaw' object has no attribute '_returning'\r\n64.229.97.140 - - [21/Feb/2018 01:21:04] \"POST /EOS_BTC_binance/query/ HTTP/1.1\" 500 -\r\n```\r\nSystem Info\r\n\r\n`Ubuntu 16.04`\r\n`Python 3.5.2`\r\n`sqlite-web (0.2.0)`"},"comment":{"url":"https://api.github.com/repos/coleifer/sqlite-web/issues/comments/367369061","html_url":"https://github.com/coleifer/sqlite-web/issues/38#issuecomment-367369061","issue_url":"https://api.github.com/repos/coleifer/sqlite-web/issues/38","id":367369061,"user":{"login":"coleifer","id":119974,"avatar_url":"https://avatars2.githubusercontent.com/u/119974?v=4","gravatar_id":"","url":"https://api.github.com/users/coleifer","html_url":"https://github.com/coleifer","followers_url":"https://api.github.com/users/coleifer/followers","following_url":"https://api.github.com/users/coleifer/following{/other_user}","gists_url":"https://api.github.com/users/coleifer/gists{/gist_id}","starred_url":"https://api.github.com/users/coleifer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coleifer/subscriptions","organizations_url":"https://api.github.com/users/coleifer/orgs","repos_url":"https://api.github.com/users/coleifer/repos","events_url":"https://api.github.com/users/coleifer/events{/privacy}","received_events_url":"https://api.github.com/users/coleifer/received_events","type":"User","site_admin":false},"created_at":"2018-02-21T15:44:54Z","updated_at":"2018-02-21T15:44:54Z","author_association":"OWNER","body":"Peewee 3.0.19 released."}}
{"actor":{"display_login":"coleifer"}}