diff --git a/src/Filters/Rules/Person/_HasNoteMatchingSubstringOf.py b/src/Filters/Rules/Person/_HasNoteMatchingSubstringOf.py index bf834a738..ec616c1c6 100644 --- a/src/Filters/Rules/Person/_HasNoteMatchingSubstringOf.py +++ b/src/Filters/Rules/Person/_HasNoteMatchingSubstringOf.py @@ -32,24 +32,13 @@ from gettext import gettext as _ # GRAMPS modules # #------------------------------------------------------------------------- -from Filters.Rules._Rule import Rule +from Filters.Rules._HasNoteSubstrBase import HasNoteSubstrBase #------------------------------------------------------------------------- # "People having notes that contain a substring" #------------------------------------------------------------------------- -class HasNoteMatchingSubstringOf(Rule): +class HasNoteMatchingSubstringOf(HasNoteSubstrBase): """People having notes containing """ - labels = [ _('Substring:')] name = _('People having notes containing ') description = _("Matches people whose notes contain text matching a substring") - category = _('General filters') - - def apply(self,db,person): - notelist = person.get_note_list() - for notehandle in notelist: - note = db.get_note_from_handle(notehandle) - n = note.get() - if n.upper().find(self.list[0].upper()) != -1: - return True - return False diff --git a/src/Filters/Rules/Person/__init__.py b/src/Filters/Rules/Person/__init__.py index beebbf9ff..20a9a4d2b 100644 --- a/src/Filters/Rules/Person/__init__.py +++ b/src/Filters/Rules/Person/__init__.py @@ -165,6 +165,7 @@ editor_rule_list = [ HasTextMatchingSubstringOf, HasNote, HasNoteRegexp, + HasNoteMatchingSubstringOf, RegExpIdOf, Disconnected, ]