From: Mike Bayer Date: Sat, 10 Feb 2007 23:41:56 +0000 (+0000) Subject: - added options() method to SelectResults, equivalent to query.options() [ticket... X-Git-Tag: rel_0_3_5~43 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ace7e3a4f19f145c390f124f6ea382ca2809bbe3;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - added options() method to SelectResults, equivalent to query.options() [ticket:472] --- diff --git a/CHANGES b/CHANGES index 6f19f3dd0c..ae46d90282 100644 --- a/CHANGES +++ b/CHANGES @@ -46,6 +46,7 @@ - ext: - added distinct() method to SelectResults. generally should only make a difference when using count(). + - added options() method to SelectResults, equivalent to query.options() [ticket:472] - added optional __table_opts__ dictionary to ActiveMapper, will send kw options to Table objects [ticket:462] - mssql: diff --git a/lib/sqlalchemy/ext/selectresults.py b/lib/sqlalchemy/ext/selectresults.py index 5ad961f0ad..eab2aa688d 100644 --- a/lib/sqlalchemy/ext/selectresults.py +++ b/lib/sqlalchemy/ext/selectresults.py @@ -27,6 +27,14 @@ class SelectResults(object): self._ops.update(ops) 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 + + See also Query.options + + """ + self._query = self._query.options(*args, **kwargs) + def count(self): """executes the SQL count() function against the SelectResults criterion.""" return self._query.count(self._clause, **self._ops)