summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/selectresults.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-03-07 01:31:41 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-03-07 01:31:41 +0000
commit231acabf72e092c8573a6a9b9a8e4acc20b79812 (patch)
tree1593461f6e444bc26fb745a3de677c6682ff39d7 /lib/sqlalchemy/ext/selectresults.py
parent08e0bd1aa7cdd4af998525c8f5098cab2c5477da (diff)
downloadsqlalchemy-231acabf72e092c8573a6a9b9a8e4acc20b79812.tar.gz
- options() method on SelectResults now implemented "generatively"
like the rest of the SelectResults methods [ticket:472]
Diffstat (limited to 'lib/sqlalchemy/ext/selectresults.py')
-rw-r--r--lib/sqlalchemy/ext/selectresults.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sqlalchemy/ext/selectresults.py b/lib/sqlalchemy/ext/selectresults.py
index d65a02f01..f498e26b0 100644
--- a/lib/sqlalchemy/ext/selectresults.py
+++ b/lib/sqlalchemy/ext/selectresults.py
@@ -33,12 +33,14 @@ class SelectResults(object):
self._joinpoint = joinpoint or (self._query.table, self._query.mapper)
def options(self,*args, **kwargs):
- """Transform the original mapper query form to an alternate form
+ """Apply mapper options to the underlying query.
See also ``Query.options``.
"""
- self._query = self._query.options(*args, **kwargs)
+ new = self.clone()
+ new._query = new._query.options(*args, **kwargs)
+ return new
def count(self):
"""Execute the SQL ``count()`` function against the ``SelectResults`` criterion."""