Mercurial > p > roundup > code
comparison roundup/hyperdb.py @ 231:afd428ba6523
better CGI text searching - but hidden filter fields are disappearing...
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 16 Aug 2001 07:34:59 +0000 |
| parents | e17a43d2c0d0 |
| children | 8827f5931ea8 |
comparison
equal
deleted
inserted
replaced
| 230:e17a43d2c0d0 | 231:afd428ba6523 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: hyperdb.py,v 1.17 2001-08-16 06:59:58 richard Exp $ | 18 # $Id: hyperdb.py,v 1.18 2001-08-16 07:34:59 richard Exp $ |
| 19 | 19 |
| 20 # standard python modules | 20 # standard python modules |
| 21 import cPickle, re, string | 21 import cPickle, re, string |
| 22 | 22 |
| 23 # roundup modules | 23 # roundup modules |
| 565 raise ValueError, 'new property "%s": %s not a %s'%( | 565 raise ValueError, 'new property "%s": %s not a %s'%( |
| 566 k, entry, self.properties[k].classname) | 566 k, entry, self.properties[k].classname) |
| 567 u.append(entry) | 567 u.append(entry) |
| 568 l.append((1, k, u)) | 568 l.append((1, k, u)) |
| 569 elif isinstance(propclass, String): | 569 elif isinstance(propclass, String): |
| 570 if '*' in v or '?' in v: | 570 # simple glob searching |
| 571 # simple glob searching | 571 v = re.sub(r'([\|\{\}\\\.\+\[\]\(\)])', r'\\\1', v) |
| 572 v = v.replace('?', '.') | 572 v = v.replace('?', '.') |
| 573 v = v.replace('*', '.*?') | 573 v = v.replace('*', '.*?') |
| 574 l.append((2, k, re.compile(v, re.I))) | 574 l.append((2, k, re.compile(v, re.I))) |
| 575 else: | 575 else: |
| 576 l.append((6, k, v)) | 576 l.append((6, k, v)) |
| 577 filterspec = l | 577 filterspec = l |
| 578 | 578 |
| 579 # now, find all the nodes that are active and pass filtering | 579 # now, find all the nodes that are active and pass filtering |
| 792 cl.create(name=option[i], order=i) | 792 cl.create(name=option[i], order=i) |
| 793 return hyperdb.Link(name) | 793 return hyperdb.Link(name) |
| 794 | 794 |
| 795 # | 795 # |
| 796 # $Log: not supported by cvs2svn $ | 796 # $Log: not supported by cvs2svn $ |
| 797 # Revision 1.17 2001/08/16 06:59:58 richard | |
| 798 # all searches use re now - and they're all case insensitive | |
| 799 # | |
| 797 # Revision 1.16 2001/08/15 23:43:18 richard | 800 # Revision 1.16 2001/08/15 23:43:18 richard |
| 798 # Fixed some isFooTypes that I missed. | 801 # Fixed some isFooTypes that I missed. |
| 799 # Refactored some code in the CGI code. | 802 # Refactored some code in the CGI code. |
| 800 # | 803 # |
| 801 # Revision 1.15 2001/08/12 06:32:36 richard | 804 # Revision 1.15 2001/08/12 06:32:36 richard |
