]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
added distinct() function to column elements for "DISTINCT <col>"
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 19 Mar 2006 16:21:33 +0000 (16:21 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 19 Mar 2006 16:21:33 +0000 (16:21 +0000)
CHANGES
lib/sqlalchemy/sql.py

diff --git a/CHANGES b/CHANGES
index 8810b1db16bc64461bd5abeb56c7eee14bb4500f..8995de9d335f39db82f40e307a9f0ef1f2e58b05 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,7 @@
 blown away if it hadnt been loaded
 - added unique_connection() method to engine, connection pool to return a connection
 that is not part of the thread-local context or any current transaction
+- added distinct() function to column elements so you can do func.count(mycol.distinct())
 
 0.1.4
 - create_engine() now uses genericized parameters; host/hostname, db/dbname/database, 
index f78d4fa7391cf2ef9f15c0a66f3ddd85c91cd34b..b88cf18cd04154475474c462661b74ed3d8ecfec 100644 (file)
@@ -490,6 +490,8 @@ class CompareMixin(object):
         return self._compare('LIKE', "%" + str(other))
     def label(self, name):
         return Label(name, self)
+    def distinct(self):
+        return CompoundClause(None,"DISTNCT", self)
     def op(self, operator):
         return lambda other: self._compare(operator, other)
     # and here come the math operators: