Re: [sqlalchemy] textcolumn.contains() escaping, the lack of icontains(), and possible bug?

2013-10-19 Thread Michael Bayer
I've also found http://www.w3.org/International/wiki/Case_folding as a great source of info of why SQLAlchemy itself shouldn't get into trying to provide case insensitive comparisons using lower() or similar. However, I have added a recipe for those who want to implement a simple

Re: [sqlalchemy] textcolumn.contains() escaping, the lack of icontains(), and possible bug?

2013-10-04 Thread Bobby Impollonia
Converting strings to lower case and comparing them is not the same as a true case-insensitive comparison. Python 3.3 adds a str.casefold method for this reason. The docs for that method give a good explanation of the distinction: Casefolding is similar to lowercasing but more aggressive

Re: [sqlalchemy] textcolumn.contains() escaping, the lack of icontains(), and possible bug?

2013-09-27 Thread Jonathan Vanasco
Any progress on considering: * icontains * istartswith * iendswith I ran into this again ( i had posted a similar request about a year or so ago ) re But then what do we do on a backend that doesn't have ilike? do we raise an error? would this be possible: .filter(

Re: [sqlalchemy] textcolumn.contains() escaping, the lack of icontains(), and possible bug?

2013-09-27 Thread Michael Bayer
On Sep 27, 2013, at 12:39 PM, Jonathan Vanasco jonat...@findmeon.com wrote: Any progress on considering: * icontains * istartswith * iendswith I ran into this again ( i had posted a similar request about a year or so ago ) re But then what do we do on a backend that doesn't have

Re: [sqlalchemy] textcolumn.contains() escaping, the lack of icontains(), and possible bug?

2013-05-16 Thread Bobby Impollonia
Sounds like a useful feature. Regarding case sensitivity, perhaps it would better if each of these methods (even like() and contains()) took a keyword argument along the lines of col.endswith('foo', case_sensitive=False) rather than adding extra methods with weird names like iendswith. On

Re: [sqlalchemy] textcolumn.contains() escaping, the lack of icontains(), and possible bug?

2013-05-16 Thread Michael Bayer
On May 16, 2013, at 6:22 PM, Bobby Impollonia bob...@gmail.com wrote: Sounds like a useful feature. Regarding case sensitivity, perhaps it would better if each of these methods (even like() and contains()) took a keyword argument along the lines of col.endswith('foo',

Re: [sqlalchemy] textcolumn.contains() escaping, the lack of icontains(), and possible bug?

2013-05-13 Thread Michael Bayer
On May 13, 2013, at 6:30 PM, Daniel Grace thisgenericn...@gmail.com wrote: So today I identified a small bug in my code and then, while trying to resolve it, came to a few realizations: 1. column.contains(str) does not escape characters in str such as % and _. Presumably,

Re: [sqlalchemy] textcolumn.contains() escaping, the lack of icontains(), and possible bug?

2013-05-13 Thread Daniel Grace
Good to hear! I took a look at #2694 and it seems that using column.contains(other, autoescape=True) might get wordy fairly quick when -- at least in new applications -- it would be a handy default. While it's probably not particularly feasible, it'd be handy if the default for autoescape