diff roundup/backends/rdbms_common.py @ 4787:4a017661e414

Closed issue2550805 (Postgresql should search title case insensitive), by Tom Ekberg.
author Bernhard Reiter <bernhard@intevation.de>
date Fri, 10 May 2013 23:24:10 +0200
parents 3adff0fb0207
children 5e679e364f9a
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py	Sun May 05 00:21:27 2013 +0200
+++ b/roundup/backends/rdbms_common.py	Fri May 10 23:24:10 2013 +0200
@@ -2440,7 +2440,14 @@
 
                     # now add to the where clause
                     where.append('('
-                        +' and '.join(["_%s._%s LIKE '%s'"%(pln, k, s) for s in v])
+                        +' and '.join(["_%s._%s %s '%s'"%(
+                                    pln,
+                                    k,
+                                    # For many databases the LIKE operator
+                                    # ignores case.  Postgres and Oracle have
+                                    # an ILIKE operator to support this.
+                                    getattr(self,'case_insensitive_like','LIKE'),
+                                    s) for s in v])
                         +')')
                     # note: args are embedded in the query string now
                 if 'sort' in p.need_for:

Roundup Issue Tracker: http://roundup-tracker.org/