Merge pull request #60 from tino097/59-textual-sql-declared-as-text
Wrap the sql expresion to sqlalchemy text
This commit is contained in:
commit
7859e01b12
|
@ -104,7 +104,7 @@ def get_top_packages(limit=20):
|
||||||
).order_by(package_stats.c.visits_recently.desc())
|
).order_by(package_stats.c.visits_recently.desc())
|
||||||
res = connection.execute(s).fetchmany(limit)
|
res = connection.execute(s).fetchmany(limit)
|
||||||
for package_id, recent, ever in res:
|
for package_id, recent, ever in res:
|
||||||
item = q.filter("package.id = '%s'" % package_id)
|
item = q.filter(text("package.id = '%s'" % package_id))
|
||||||
if not item.count():
|
if not item.count():
|
||||||
continue
|
continue
|
||||||
items.append((item.first(), recent, ever))
|
items.append((item.first(), recent, ever))
|
||||||
|
|
Loading…
Reference in New Issue