SQLite compatibility

This commit is contained in:
Yax 2015-05-04 20:01:47 +02:00
parent 2d29502e5f
commit f29a53be94
3 changed files with 5 additions and 2 deletions

1
.gitignore vendored
View file

@ -58,3 +58,4 @@ target/
# My ignored files and directories
myconfig.json
db.sqlite

View file

@ -26,7 +26,7 @@ def query_comments():
logger.info('retrieve comments for token %s, url %s' % (token, url))
for comment in Comment.select(Comment).join(Site).where(
(Comment.url == url) &
(Site.token == token)).order_by(Comment.published):
(Site.token == token)).order_by(+Comment.published):
d = {}
d['author'] = comment.author_name
d['content'] = comment.content
@ -35,6 +35,7 @@ def query_comments():
if comment.author_email:
d['avatar'] = md5(comment.author_email.strip().lower())
d['date'] = comment.published.strftime("%Y-%m-%d %H:%M:%S")
logger.info(d)
comments.append(d)
r = jsonify({'data': comments})
r.status_code = 200

View file

@ -2,7 +2,8 @@
DEBUG = True
DB_URL = "mysql://stacosys_user:stacosys_password@localhost:3306/stacosys"
#DB_URL = "mysql://stacosys_user:stacosys_password@localhost:3306/stacosys"
DB_URL = "sqlite:///db.sqlite"
HTTP_ADDRESS = "0.0.0.0"
HTTP_PORT = 8000