comparison roundup/backends/back_sqlite.py @ 5318:506c7ee9a385

Add a 'retired' parameter to Class.filter .. to allow searching for retired, non-retired or all (retired and non-retired) items similar to the argument of the same name to Class.getnodeids. This is 'False' by default (finding only non-retired items for backwards compatibility) and can be set to None (for finding retired and non-retired items) or True (for finding only retired items).
author Ralf Schlatterbeck <rsc@runtux.com>
date Thu, 19 Apr 2018 20:01:43 +0200
parents 198b6e810c67
children 62de601bdf6f
comparison
equal deleted inserted replaced
5317:c0cda00af479 5318:506c7ee9a385
437 cols = range(5) 437 cols = range(5)
438 return [[row[col] for col in cols] for row in l] 438 return [[row[col] for col in cols] for row in l]
439 439
440 class sqliteClass: 440 class sqliteClass:
441 def filter(self, search_matches, filterspec, sort=(None,None), 441 def filter(self, search_matches, filterspec, sort=(None,None),
442 group=(None,None)): 442 group=(None,None), retired=False):
443 """ If there's NO matches to a fetch, sqlite returns NULL 443 """ If there's NO matches to a fetch, sqlite returns NULL
444 instead of nothing 444 instead of nothing
445 """ 445 """
446 return [f for f in rdbms_common.Class.filter(self, search_matches, 446 return [f for f in rdbms_common.Class.filter(self, search_matches,
447 filterspec, sort=sort, group=group) if f] 447 filterspec, sort=sort, group=group, retired=retired) if f]
448 448
449 class Class(sqliteClass, rdbms_common.Class): 449 class Class(sqliteClass, rdbms_common.Class):
450 pass 450 pass
451 451
452 class IssueClass(sqliteClass, rdbms_common.IssueClass): 452 class IssueClass(sqliteClass, rdbms_common.IssueClass):

Roundup Issue Tracker: http://roundup-tracker.org/