Modifications so that GenericFilters can be applied to a PeopleModel.

svn: r9665
This commit is contained in:
Brian Matherly
2007-12-31 22:22:12 +00:00
parent cfbcdce095
commit e90e15c4af
4 changed files with 16 additions and 5 deletions

View File

@@ -51,8 +51,13 @@ class GenericFilter:
self.logical_op = 'and'
self.invert = False
def match(self,handle):
return True
def match(self,handle,db):
"""Return True or False depending on whether the handle matches the
filter """
if self.apply(db,[handle]):
return True
else:
return False
def is_empty(self):
return len(self.flist) == 0 or (len(self.flist) == 1 and self.flist[0].is_empty())