Michael Bayer wrote:
>
> On Aug 7, 1:20 pm, Paul Colomiets <[EMAIL PROTECTED]> wrote:
>   
>> 1. func.if_(...) - tries to sql function "if_(...)",
>> but func._if(...) - "_i(...)"
>> I believe is typo?
>>     
>
> er, probably.  func is trying to sidestep various "_" underscore
> attributes i think.  do you need to say "_if(...)" ?

No I need to say "IF" but I can't say func.if() currently I use 
getattr('func','if') but It's ugly.

It strips last char when sees first underscore. But should ether strip 
first char, or check end of string for an underscore.

Patch attached :)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Index: lib/sqlalchemy/sql.py
===================================================================
--- lib/sqlalchemy/sql.py	(revision 3197)
+++ lib/sqlalchemy/sql.py	(working copy)
@@ -741,7 +741,7 @@
             except KeyError:
                 raise AttributeError(name)
                 
-        elif name.startswith('_'):
+        elif name.endswith('_'):
             name = name[0:-1]
         f = _FunctionGenerator(**self.opts)
         f.__names = list(self.__names) + [name]

Reply via email to