From 920535e3f6013b7ca00b5f0015c8a3ad137629de Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Wed, 20 Oct 2010 20:26:23 +0000 Subject: [PATCH] fix in name object and quickview for names svn: r16020 --- src/gen/lib/name.py | 2 +- src/gen/lib/surnamebase.py | 1 - src/plugins/quickview/SameSurnames.py | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gen/lib/name.py b/src/gen/lib/name.py index 73c0f10ea..9e52beac5 100644 --- a/src/gen/lib/name.py +++ b/src/gen/lib/name.py @@ -266,7 +266,7 @@ class Name(SecondaryObject, PrivacyBase, SurnameBase, SourceBase, NoteBase, if self.group_as: return self.group_as else: - return self.surname + return self.get_primary_surname().get_surname() def set_sort_as(self, value): """ diff --git a/src/gen/lib/surnamebase.py b/src/gen/lib/surnamebase.py index 7b570e9e9..82186e9be 100644 --- a/src/gen/lib/surnamebase.py +++ b/src/gen/lib/surnamebase.py @@ -228,4 +228,3 @@ class SurnameBase(object): conn = surn.get_connector() if conn: connl.append(conn) - \ No newline at end of file diff --git a/src/plugins/quickview/SameSurnames.py b/src/plugins/quickview/SameSurnames.py index 96da9ada7..3aacac8ff 100644 --- a/src/plugins/quickview/SameSurnames.py +++ b/src/plugins/quickview/SameSurnames.py @@ -54,7 +54,7 @@ class SameSurname(Rule): def apply(self, db, person): src = self.list[0].upper() for name in [person.get_primary_name()] + person.get_alternate_names(): - if name.surname and name.surname.upper() == src.upper(): + if name.get_surname() and name.get_surname().upper() == src.upper(): return True return False @@ -103,7 +103,7 @@ def run(database, document, person): surname = person rsurname = person # display the title - sdoc.title(_("People with the surname '%s'") % surname) + sdoc.title(_("People sharing the surname '%s'") % surname) sdoc.paragraph("") stab.columns(_("Person"), _("Birth Date"), _("Name type")) filter = GenericFilterFactory('Person')()