From 09080baad1a9f910a5a406dfad9241104ccbc6d8 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sat, 4 Jun 2011 20:52:30 -0400 Subject: - Adjusted the __contains__() method of a RowProxy result row such that no exception throw is generated internally; NoSuchColumnError() also will generate its message regardless of whether or not the column construct can be coerced to a string. [ticket:2178]. Also in 0.6.8. --- lib/sqlalchemy/sql/expression.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/expression.py b/lib/sqlalchemy/sql/expression.py index 38eb71da8..ec0801405 100644 --- a/lib/sqlalchemy/sql/expression.py +++ b/lib/sqlalchemy/sql/expression.py @@ -1207,6 +1207,15 @@ def _escape_for_generated(x): else: return x.replace('%', '%%') +def _string_or_unprintable(element): + if isinstance(element, basestring): + return element + else: + try: + return str(element) + except: + return "unprintable element %r" % element + def _clone(element): return element._clone() -- cgit v1.2.1