From d3b47b000c7f6202533e1449bc9215b1e24f7dc2 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 8 May 2011 03:47:40 +0000 Subject: [PATCH] Bring gramps-connect up to date with gramps 3.3 svn: r17452 --- src/web/grampsdb/models.py | 14 +++++++++++--- src/web/libdjango.py | 1 - 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/web/grampsdb/models.py b/src/web/grampsdb/models.py index e93d3b6f2..38c7a3ff8 100644 --- a/src/web/grampsdb/models.py +++ b/src/web/grampsdb/models.py @@ -445,7 +445,10 @@ class Person(PrimaryObject): """ Return the preferred name of a person. """ - return self.name_set.get(preferred=True) + try: + return self.name_set.get(preferred=True) + except: + return "" def __unicode__(self): return str(self.get_primary_name()) @@ -595,7 +598,10 @@ class Name(DateObject, SecondaryObject): _sanitized = False def get_primary_surname(self): - return self.surname_set.get(primary=True).surname + try: + return self.surname_set.get(primary=True).surname + except: + return "" def __unicode__(self): return "%s, %s" % (self.get_primary_surname(), @@ -615,7 +621,9 @@ class Name(DateObject, SecondaryObject): self.title = "" def make_surname_list(self): - return [] + return [(x.surname, x.prefix, x.primary, + tuple(x.name_origin_type), x.connector) for x in + self.surname_set.all()] class Lds(DateObject, SecondaryObject): """ diff --git a/src/web/libdjango.py b/src/web/libdjango.py index f725ec68e..569536b82 100644 --- a/src/web/libdjango.py +++ b/src/web/libdjango.py @@ -598,7 +598,6 @@ class DjangoInterface(object): self.add_event_ref(obj, event_ref) def add_surname_list(self, name, surname_list): - print surname_list, name for data in surname_list: (surname_text, prefix, primary, origin_type, connector) = data