summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy
diff options
context:
space:
mode:
authorMalaclypse The Younger <pat-androidsrc@flyingcarsandstuff.com>2017-03-30 10:54:14 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2017-03-30 12:33:33 -0400
commit74f6c21747d07a8cf9902900df9280a84aadc2bb (patch)
treeed015e93b69651ac81ca55d4b2162b4589418634 /lib/sqlalchemy
parenta4c17c1397c68d109bcf0603644f3200ab2e82f5 (diff)
downloadsqlalchemy-74f6c21747d07a8cf9902900df9280a84aadc2bb.tar.gz
Add bindparams support for baked Result count() method
Added support for bound parameters, e.g. those normally set up via :meth:`.Query.params`, to the :meth:`.baked.Result.count` method. Previously, support for parameters were omitted. Pull request courtesy Pat Deegan. Change-Id: I8c33548cf2a483699767e459731694c8cadebff6 Pull-request: https://github.com/zzzeek/sqlalchemy/pull/350
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r--lib/sqlalchemy/ext/baked.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sqlalchemy/ext/baked.py b/lib/sqlalchemy/ext/baked.py
index 090466618..68bd468b9 100644
--- a/lib/sqlalchemy/ext/baked.py
+++ b/lib/sqlalchemy/ext/baked.py
@@ -268,7 +268,7 @@ class Result(object):
col = func.count(literal_column('*'))
bq = self.bq.with_criteria(lambda q: q.from_self(col))
- return bq.for_session(self.session).scalar()
+ return bq.for_session(self.session).params(self._params).scalar()
def scalar(self):
"""Return the first element of the first result or None