summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2016-09-20 11:54:47 -0400
committerGerrit Code Review <gerrit2@ln3.zzzcomputing.com>2016-09-20 11:54:47 -0400
commitdea7c2bd8e7e852b6a41d6e0ec3af35f33917a70 (patch)
tree3c8d62c40fa7d92b7aa0dd9a413553274b8cb37e /lib
parente49292894a7b5a372d0e930691d65002ae1537c6 (diff)
parent8c3b9d6083709311c6125d812b242f9e31a90065 (diff)
downloadsqlalchemy-dea7c2bd8e7e852b6a41d6e0ec3af35f33917a70.tar.gz
Merge "Support bindparam() with callable for primaryjoin"
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/strategies.py2
-rw-r--r--lib/sqlalchemy/sql/elements.py3
2 files changed, 3 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/strategies.py b/lib/sqlalchemy/orm/strategies.py
index 0b22b8486..202b652b7 100644
--- a/lib/sqlalchemy/orm/strategies.py
+++ b/lib/sqlalchemy/orm/strategies.py
@@ -478,7 +478,7 @@ class LazyLoader(AbstractRelationshipLoader, util.MemoizedSlots):
params.append((
bindparam.key, bind_to_col[bindparam._identifying_key],
None))
- else:
+ elif bindparam.callable is None:
params.append((bindparam.key, None, bindparam.value))
criterion = visitors.cloned_traverse(
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."""