From fe0cf718b10b0370a64f6d7f82dce986d2de0aba Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Fri, 19 Jan 2007 20:51:05 +0000 Subject: [PATCH] - trailing underscores are trimmed from func. calls, such as func.if_() --- CHANGES | 1 + lib/sqlalchemy/sql.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index 1f8c26d7bf..6d6aaf794a 100644 --- a/CHANGES +++ b/CHANGES @@ -8,6 +8,7 @@ - added "fetchmany()" support to ResultProxy - changed "BooleanExpression" to subclass from "BinaryExpression", so that boolean expressions can also follow column-clause behaviors (i.e. label(), etc). + - trailing underscores are trimmed from func. calls, such as func.if_() - fix to correlation of subqueries when the column list of the select statement is constructed with individual calls to append_column(); this fixes an ORM bug whereby nested select statements were not getting correlated with the diff --git a/lib/sqlalchemy/sql.py b/lib/sqlalchemy/sql.py index e0bae905a0..f944b468d6 100644 --- a/lib/sqlalchemy/sql.py +++ b/lib/sqlalchemy/sql.py @@ -274,6 +274,8 @@ class _FunctionGateway(object): """returns a callable based on an attribute name, which then returns a _Function object with that name.""" def __getattr__(self, name): + if name[-1] == '_': + name = name[0:-1] return getattr(_FunctionGenerator(), name) func = _FunctionGateway() -- 2.47.2