2953: wrong handling of gramps id's on individual report. I44 and I440 I441 etc are all included when only I44 should be

svn: r15850
This commit is contained in:
Benny Malengier
2010-09-02 21:03:53 +00:00
parent 81aaf690f3
commit 140ce8077d

View File

@@ -2,6 +2,7 @@
# Gramps - a GTK+/GNOME based genealogy program # Gramps - a GTK+/GNOME based genealogy program
# #
# Copyright (C) 2002-2006 Donald N. Allingham # Copyright (C) 2002-2006 Donald N. Allingham
# Copyright (C) 2010 Raphael Ackermann
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@@ -40,7 +41,7 @@ from Filters.Rules import Rule
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
class HasGrampsId(Rule): class HasGrampsId(Rule):
"""Rule that checks for a person with a specific GRAMPS ID.""" """Rule that checks for an object with a specific GRAMPS ID."""
labels = [ _('ID:') ] labels = [ _('ID:') ]
name = _('Object with <Id>') name = _('Object with <Id>')
@@ -48,4 +49,8 @@ class HasGrampsId(Rule):
category = _('General filters') category = _('General filters')
def apply(self, db, obj): def apply(self, db, obj):
return obj.gramps_id.find(self.list[0]) !=-1 """
apply the rule on the obj.
return true if the rule passes, false otherwise.
"""
return obj.gramps_id == self.list[0]