summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/selectresults.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/ext/selectresults.py')
-rw-r--r--lib/sqlalchemy/ext/selectresults.py6
1 files changed, 6 insertions, 0 deletions
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.