Upstream Autotest merge.
As titled, a merge up to 93fc426ca133e775eb495f34d138fc57d92fb55e.
- Removes a bunch of deprecated code.
- Moves several private utilities into the private repo.
- Couple changes ported upstream and resynced.
BUG=None
TEST=In progress... will spin up new Autotest server and use
run_remote_tests for bvt, regression, smoke.
Change-Id: Id3e2ad529bb7b05f148e5d98aea46bb9ea828200
Reviewed-on: http://gerrit.chromium.org/gerrit/3350
Tested-by: Dale Curtis <dalecurtis@chromium.org>
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
diff --git a/frontend/tko/models.py b/frontend/tko/models.py
index 483eb13..9b0d408 100644
--- a/frontend/tko/models.py
+++ b/frontend/tko/models.py
@@ -24,7 +24,9 @@
def _get_group_query_sql(self, query, group_by):
- sql, params = query.query.as_sql()
+ compiler = query.query.get_compiler(using=query.db)
+ sql, params = compiler.as_sql()
+
# insert GROUP BY clause into query
group_fields = self._get_field_names(group_by, query.query.extra_select)
@@ -79,7 +81,8 @@
group_fields = self._get_field_names(group_by, query.query.extra_select)
query = query.order_by() # this can mess up the query and isn't needed
- sql, params = query.query.as_sql()
+ compiler = query.query.get_compiler(using=query.db)
+ sql, params = compiler.as_sql()
from_ = sql[sql.find(' FROM'):]
return ('SELECT DISTINCT %s %s' % (','.join(group_fields),
from_),