From cf7e168345cd5724bf4f38cb6db85c9e2ca82463 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 12 Aug 2006 20:25:38 +0000 Subject: [PATCH] fixed construction of order_by with distinct query --- lib/sqlalchemy/orm/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py index 3b04575c12..1e9d40c753 100644 --- a/lib/sqlalchemy/orm/query.py +++ b/lib/sqlalchemy/orm/query.py @@ -364,7 +364,7 @@ class Query(object): # to use it in "order_by". insure they are in the column criterion (particularly oid). # TODO: this should be done at the SQL level not the mapper level if kwargs.get('distinct', False) and order_by: - statement.append_column(*util.to_list(order_by)) + [statement.append_column(c) for c in util.to_list(order_by)] # plugin point # give all the attached properties a chance to modify the query -- 2.47.2