summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/default_comparator.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2015-08-22 12:47:13 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2015-08-22 12:47:13 -0400
commit8712ef2f81498fe59b9636ba150833d779e60781 (patch)
tree8e42639b148196a22d930fdef851b44686886279 /lib/sqlalchemy/sql/default_comparator.py
parente0a8030048f4ad0690d3084929441bda4c21aba2 (diff)
downloadsqlalchemy-8712ef2f81498fe59b9636ba150833d779e60781.tar.gz
- Added new checks for the common error case of passing mapped classes
or mapped instances into contexts where they are interpreted as SQL bound parameters; a new exception is raised for this. fixes #3321
Diffstat (limited to 'lib/sqlalchemy/sql/default_comparator.py')
-rw-r--r--lib/sqlalchemy/sql/default_comparator.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/default_comparator.py b/lib/sqlalchemy/sql/default_comparator.py
index 09f639163..125fec33f 100644
--- a/lib/sqlalchemy/sql/default_comparator.py
+++ b/lib/sqlalchemy/sql/default_comparator.py
@@ -15,7 +15,7 @@ from .elements import BindParameter, True_, False_, BinaryExpression, \
Null, _const_expr, _clause_element_as_expr, \
ClauseList, ColumnElement, TextClause, UnaryExpression, \
collate, _is_literal, _literal_as_text, ClauseElement, and_, or_, \
- Slice
+ Slice, Visitable
from .selectable import SelectBase, Alias, Selectable, ScalarSelect
@@ -304,7 +304,7 @@ def _check_literal(expr, operator, other):
if isinstance(other, (SelectBase, Alias)):
return other.as_scalar()
- elif not isinstance(other, (ColumnElement, TextClause)):
+ elif not isinstance(other, Visitable):
return expr._bind_param(operator, other)
else:
return other