Mercurial > p > roundup > code
comparison roundup/backends/back_sqlite.py @ 5867:ee2e8f8d6648
Implement exact string search
.. in the 'filter' method of hyperdb.Class (and the corresponding
backend implementations).
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Mon, 26 Aug 2019 18:18:02 +0200 |
| parents | 56c9bcdea47f |
| children | 16e1255b16cf |
comparison
equal
deleted
inserted
replaced
| 5865:04deafac71ab | 5867:ee2e8f8d6648 |
|---|---|
| 453 cols = range(5) | 453 cols = range(5) |
| 454 return [[row[col] for col in cols] for row in l] | 454 return [[row[col] for col in cols] for row in l] |
| 455 | 455 |
| 456 class sqliteClass: | 456 class sqliteClass: |
| 457 def filter(self, search_matches, filterspec, sort=(None,None), | 457 def filter(self, search_matches, filterspec, sort=(None,None), |
| 458 group=(None,None), retired=False): | 458 group=(None,None), retired=False, exact_match_spec={}): |
| 459 """ If there's NO matches to a fetch, sqlite returns NULL | 459 """ If there's NO matches to a fetch, sqlite returns NULL |
| 460 instead of nothing | 460 instead of nothing |
| 461 """ | 461 """ |
| 462 return [f for f in rdbms_common.Class.filter(self, search_matches, | 462 return [f for f in rdbms_common.Class.filter(self, search_matches, |
| 463 filterspec, sort=sort, group=group, retired=retired) if f] | 463 filterspec, sort=sort, group=group, retired=retired, |
| 464 exact_match_spec=exact_match_spec) if f] | |
| 464 | 465 |
| 465 class Class(sqliteClass, rdbms_common.Class): | 466 class Class(sqliteClass, rdbms_common.Class): |
| 466 pass | 467 pass |
| 467 | 468 |
| 468 class IssueClass(sqliteClass, rdbms_common.IssueClass): | 469 class IssueClass(sqliteClass, rdbms_common.IssueClass): |
