sql.func leading/trailing underscore confusion

Issue #996 resolved
Former user created an issue

function names beginning with underscore are truncated. I think r2218 got confused somewhere.

--- lib/sqlalchemy/sql/expression.py    (revision 4337)
+++ lib/sqlalchemy/sql/expression.py    (working copy)
@@ -777,7 +777,7 @@
             except KeyError:
                 raise AttributeError(name)

-        elif name.startswith('_'):
+        elif name.endswith('_'):
             name = name[0:-1](0:-1)
         f = _FunctionGenerator(**self.opts)
         f.__names = list(self.__names) + [name](name)

Comments (1)

  1. Log in to comment