Fix ignored SQL where clauses

This commit is contained in:
skje 2016-04-04 16:03:21 -07:00 committed by Maxime Beauchemin
parent 2b31ab498b
commit 9c1af66ba4

View File

@ -575,6 +575,8 @@ class SqlaTable(Model, Queryable, AuditMixinNullable):
having_clause_and += [text(extras['having'])]
if granularity:
qry = qry.where(and_(*(time_filter + where_clause_and)))
else:
qry = qry.where(and_(*where_clause_and))
qry = qry.having(and_(*having_clause_and))
if groupby:
qry = qry.order_by(desc(main_metric_expr))