From: Mike Bayer Date: Sat, 12 Aug 2006 20:25:38 +0000 (+0000) Subject: fixed construction of order_by with distinct query X-Git-Tag: rel_0_2_7~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf7e168345cd5724bf4f38cb6db85c9e2ca82463;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fixed construction of order_by with distinct query --- 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