Mercurial > p > roundup > code
comparison roundup/cgi/templating.py @ 1631:8a908bbad1ef
A couple of form value handling changes:
- multilink properties may hhave multiple form values "1", "2,4", "5", ...
- string search properties are split on whitespace and match any of the
values
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 09 May 2003 01:47:51 +0000 |
| parents | 21312a7564fd |
| children | ac5f7e5a11e5 |
comparison
equal
deleted
inserted
replaced
| 1629:27768800be5c | 1631:8a908bbad1ef |
|---|---|
| 1455 self.filterspec = {} | 1455 self.filterspec = {} |
| 1456 db = self.client.db | 1456 db = self.client.db |
| 1457 if self.classname is not None: | 1457 if self.classname is not None: |
| 1458 props = db.getclass(self.classname).getprops() | 1458 props = db.getclass(self.classname).getprops() |
| 1459 for name in self.filter: | 1459 for name in self.filter: |
| 1460 if self.form.has_key(name): | 1460 if not self.form.has_key(name): |
| 1461 prop = props[name] | 1461 continue |
| 1462 fv = self.form[name] | 1462 prop = props[name] |
| 1463 if (isinstance(prop, hyperdb.Link) or | 1463 fv = self.form[name] |
| 1464 isinstance(prop, hyperdb.Multilink)): | 1464 if (isinstance(prop, hyperdb.Link) or |
| 1465 self.filterspec[name] = lookupIds(db, prop, | 1465 isinstance(prop, hyperdb.Multilink)): |
| 1466 handleListCGIValue(fv)) | 1466 self.filterspec[name] = lookupIds(db, prop, |
| 1467 handleListCGIValue(fv)) | |
| 1468 else: | |
| 1469 if isinstance(fv, type([])): | |
| 1470 self.filterspec[name] = [v.value for v in fv] | |
| 1467 else: | 1471 else: |
| 1468 self.filterspec[name] = fv.value | 1472 self.filterspec[name] = fv.value |
| 1469 | 1473 |
| 1470 # full-text search argument | 1474 # full-text search argument |
| 1471 self.search_text = None | 1475 self.search_text = None |
