Michael Bayer wrote:


the startswith/endswith functions are just sticking a "%" on either
side of a string argument and using LIKE.  im not exactly sure how they
could accept a bindparam argument since there is a string concatenation
that must take place within the python space.

Since the startswith parameter should be a string, you don't need to use the + operator to concatenate, but...

>>> '%(oper)s%(literal)s' % {'oper': 'my', 'literal': '%'}
'my%'

instead of...
>>> '%(oper)s + %(literal)s' % {'oper': 'my', 'literal': '%'}
 'my + %'

you should instead use
LIKE directly with your own bindparam that includes a "%" on the left
or right side of the string expression.

Yes, I know, but if I can use LIKE instead of start/end{swith}. I wonder why we have those operators in sqlalchemy, with partial functionality? ;-)

jo


>


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to