Mercurial > p > roundup > code
comparison roundup/backends/back_mysql.py @ 2509:ea887c804103 maint-0.7
merge from HEAD
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Tue, 29 Jun 2004 05:53:37 +0000 |
| parents | 3fe516581aa3 |
| children | 50da6d3bac46 |
comparison
equal
deleted
inserted
replaced
| 2506:f89a84f881f0 | 2509:ea887c804103 |
|---|---|
| 605 where.append(' or '.join(["_%s._%s LIKE '%s'"%(cn, k, s) | 605 where.append(' or '.join(["_%s._%s LIKE '%s'"%(cn, k, s) |
| 606 for s in v])) | 606 for s in v])) |
| 607 # note: args are embedded in the query string now | 607 # note: args are embedded in the query string now |
| 608 elif isinstance(propclass, Link): | 608 elif isinstance(propclass, Link): |
| 609 if isinstance(v, type([])): | 609 if isinstance(v, type([])): |
| 610 if '-1' in v: | 610 d = {} |
| 611 v = v[:] | 611 for entry in v: |
| 612 v.remove('-1') | 612 if entry == '-1': |
| 613 xtra = ' or _%s._%s is NULL'%(cn, k) | 613 entry = None |
| 614 else: | 614 d[entry] = entry |
| 615 xtra = '' | 615 l = [] |
| 616 if v: | 616 if d.has_key(None) or not d: |
| 617 del d[None] | |
| 618 l.append('_%s._%s is NULL'%(cn, k)) | |
| 619 if d: | |
| 620 v = d.keys() | |
| 617 s = ','.join([a for x in v]) | 621 s = ','.join([a for x in v]) |
| 618 where.append('(_%s._%s in (%s)%s)'%(cn, k, s, xtra)) | 622 where.append('(_%s._%s in (%s))'%(cn, k, s)) |
| 619 args = args + v | 623 args = args + v |
| 620 else: | 624 where.append(' or '.join(l)) |
| 621 where.append('_%s._%s is NULL'%(cn, k)) | |
| 622 else: | 625 else: |
| 623 if v == '-1': | 626 if v in ('-1', None): |
| 624 v = None | 627 v = None |
| 625 where.append('_%s._%s is NULL'%(cn, k)) | 628 where.append('_%s._%s is NULL'%(cn, k)) |
| 626 else: | 629 else: |
| 627 where.append('_%s._%s=%s'%(cn, k, a)) | 630 where.append('_%s._%s=%s'%(cn, k, a)) |
| 628 args.append(v) | 631 args.append(v) |
