]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fixed construction of order_by with distinct query
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 12 Aug 2006 20:25:38 +0000 (20:25 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 12 Aug 2006 20:25:38 +0000 (20:25 +0000)
lib/sqlalchemy/orm/query.py

index 3b04575c12aa0fd6436d2fc218d1abb9ffc6e98b..1e9d40c7535fefcaf44f9dcf8406d3df813f9f44 100644 (file)
@@ -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