From 8c3b9d6083709311c6125d812b242f9e31a90065 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 19 Sep 2016 16:22:08 -0400 Subject: Support bindparam() with callable for primaryjoin Fixes the comparison of bindparam() objects based on the "callable" parameter being present which helps to correctly detect use_get, and also checks for "callable" when detecting parameters for value substitution and will not impact the object if present. Change-Id: I4c93ee5d404d2648dd9835beeae0c5fb67e37d19 Fixes: #3767 --- lib/sqlalchemy/sql/elements.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index cff57372c..768574c1a 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -1145,7 +1145,8 @@ class BindParameter(ColumnElement): return isinstance(other, BindParameter) \ and self.type._compare_type_affinity(other.type) \ - and self.value == other.value + and self.value == other.value \ + and self.callable == other.callable def __getstate__(self): """execute a deferred value for serialization purposes.""" -- cgit v1.2.1