Mercurial > p > roundup > code
comparison roundup/backends/rdbms_common.py @ 1550:905f92b97d4e maint-0.5
backport of mail address case problem from HEAD
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 24 Mar 2003 04:53:15 +0000 |
| parents | c8a596aa5aba |
| children | 44319ba5a7a7 |
comparison
equal
deleted
inserted
replaced
| 1541:a61ca144d3a4 | 1550:905f92b97d4e |
|---|---|
| 1 # $Id: rdbms_common.py,v 1.27.2.7 2003-03-14 02:52:03 richard Exp $ | 1 # $Id: rdbms_common.py,v 1.27.2.8 2003-03-24 04:53:14 richard Exp $ |
| 2 ''' Relational database (SQL) backend common code. | 2 ''' Relational database (SQL) backend common code. |
| 3 | 3 |
| 4 Basics: | 4 Basics: |
| 5 | 5 |
| 6 - map roundup classes to relational tables | 6 - map roundup classes to relational tables |
| 1664 raise TypeError, "'%s' not a String property"%propname | 1664 raise TypeError, "'%s' not a String property"%propname |
| 1665 where.append(propname) | 1665 where.append(propname) |
| 1666 args.append(requirements[propname].lower()) | 1666 args.append(requirements[propname].lower()) |
| 1667 | 1667 |
| 1668 # generate the where clause | 1668 # generate the where clause |
| 1669 s = ' and '.join(['_%s=%s'%(col, self.db.arg) for col in where]) | 1669 s = ' and '.join(['lower(_%s)=%s'%(col, self.db.arg) for col in where]) |
| 1670 sql = 'select id from _%s where %s'%(self.classname, s) | 1670 sql = 'select id from _%s where %s'%(self.classname, s) |
| 1671 self.db.sql(sql, tuple(args)) | 1671 self.db.sql(sql, tuple(args)) |
| 1672 l = [x[0] for x in self.db.sql_fetchall()] | 1672 l = [x[0] for x in self.db.sql_fetchall()] |
| 1673 if __debug__: | 1673 if __debug__: |
| 1674 print >>hyperdb.DEBUG, 'find ... ', l | 1674 print >>hyperdb.DEBUG, 'find ... ', l |
