From 55d455d7d0d4d67d9f3d13cf74de471c15ce5d50 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 5 Feb 2007 23:26:37 +0000 Subject: - added distinct() method to SelectResults. generally should only make a difference when using count(). --- lib/sqlalchemy/ext/selectresults.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/sqlalchemy/ext') diff --git a/lib/sqlalchemy/ext/selectresults.py b/lib/sqlalchemy/ext/selectresults.py index 3e7fa93c8..5ad961f0a 100644 --- a/lib/sqlalchemy/ext/selectresults.py +++ b/lib/sqlalchemy/ext/selectresults.py @@ -89,6 +89,12 @@ class SelectResults(object): """apply an OFFSET to the query.""" return self[offset:] + def distinct(self): + """applies a DISTINCT to the query""" + new = self.clone() + new._ops['distinct'] = True + return new + def list(self): """return the results represented by this SelectResults as a list. -- cgit v1.2.1