Exemplo n.º 1
0
 def log(self, ltype, action, handles):
     for handle in set(handles):
         if self.last_log == (ltype, action, handle):
             continue
         self.last_log = (ltype, action, handle)
         self.timestamp()
         # Translators: needed for French, ignore otherwise
         self.append_text(_("%s: ") % _(action))
         if action == 'Deleted':
             transaction = self.dbstate.db.transaction
             if ltype == 'Person':
                 name = 'a person'
                 if transaction is not None:
                     for i in transaction.get_recnos(reverse=True):
                         (obj_type, trans_type, hndl, old_data, dummy) = \
                                 transaction.get_record(i)
                         if isinstance(hndl, bytes):
                             hndl = str(hndl, "utf-8")
                         if (obj_type == PERSON_KEY and trans_type == TXNDEL
                                 and hndl == handle):
                             person = Person()
                             person.unserialize(old_data)
                             name = name_displayer.display(person)
                             break
             elif ltype == 'Family':
                 name = 'a family'
                 if transaction is not None:
                     for i in transaction.get_recnos(reverse=True):
                         (obj_type, trans_type, hndl, old_data, dummy) = \
                                 transaction.get_record(i)
                         if isinstance(hndl, bytes):
                             hndl = str(hndl, "utf-8")
                         if (obj_type == FAMILY_KEY and trans_type == TXNDEL
                                 and hndl == handle):
                             family = Family()
                             family.unserialize(old_data)
                             name = family_name(family, self.dbstate.db,
                                                name)
                             break
             self.append_text(name)
         else:
             if ltype == 'Person':
                 person = self.dbstate.db.get_person_from_handle(handle)
                 name = name_displayer.display(person)
             elif ltype == 'Family':
                 family = self.dbstate.db.get_family_from_handle(handle)
                 name = family_name(family, self.dbstate.db, 'a family')
             self.link(name, ltype, handle)
         self.append_text("\n")
Exemplo n.º 2
0
 def log(self, ltype, action, handles):
     for handle in set(handles):
         if self.last_log == (ltype, action, handle):
             continue
         self.last_log = (ltype, action, handle)
         self.timestamp()
         # translators: needed for French, ignore otherwise
         self.append_text(_("%s: ") % _(action))
         if action == 'Deleted':
             transaction = self.dbstate.db.transaction
             if ltype == 'Person':
                 name = 'a person'
                 if transaction is not None:
                     for i in transaction.get_recnos(reverse=True):
                         (obj_type, trans_type, hndl, old_data, dummy) = \
                                 transaction.get_record(i)
                         if isinstance(hndl, bytes):
                             hndl = str(hndl, "utf-8")
                         if (obj_type == PERSON_KEY and trans_type == TXNDEL
                                 and hndl == handle):
                             person = Person()
                             person.unserialize(old_data)
                             name = name_displayer.display(person)
                             break
             elif ltype == 'Family':
                 name = 'a family'
                 if transaction is not None:
                     for i in transaction.get_recnos(reverse=True):
                         (obj_type, trans_type, hndl, old_data, dummy) = \
                                 transaction.get_record(i)
                         if isinstance(hndl, bytes):
                             hndl = str(hndl, "utf-8")
                         if (obj_type == FAMILY_KEY and trans_type == TXNDEL
                                 and hndl == handle):
                             family = Family()
                             family.unserialize(old_data)
                             name = family_name(family, self.dbstate.db, name)
                             break
             self.append_text(name)
         else:
             if ltype == 'Person':
                 person = self.dbstate.db.get_person_from_handle(handle)
                 name = name_displayer.display(person)
             elif ltype == 'Family':
                 family = self.dbstate.db.get_family_from_handle(handle)
                 name = family_name(family, self.dbstate.db, 'a family')
             self.link(name, ltype, handle)
         self.append_text("\n")
Exemplo n.º 3
0
 def name_from_gramps_id(self, gramps_id):
     if self.namespace == 'Person':
         person = self.db.get_person_from_gramps_id(gramps_id)
         name = _nd.display_name(person.get_primary_name())
     elif self.namespace == 'Family':
         family = self.db.get_family_from_gramps_id(gramps_id)
         name = family_name(family, self.db)
     elif self.namespace == 'Event':
         event = self.db.get_event_from_gramps_id(gramps_id)
         name = str(event.get_type)
     elif self.namespace == 'Place':
         place = self.db.get_place_from_gramps_id(gramps_id)
         name = _pd.display(self.db, place)
     elif self.namespace == 'Source':
         source = self.db.get_source_from_gramps_id(gramps_id)
         name = source.get_title()
     elif self.namespace == 'Citation':
         citation = self.db.get_citation_from_gramps_id(gramps_id)
         name = citation.get_page()
     elif self.namespace == 'Media':
         obj = self.db.get_media_from_gramps_id(gramps_id)
         name = obj.get_path()
     elif self.namespace == 'Repository':
         repo = self.db.get_repository_from_gramps_id(gramps_id)
         name = repo.get_name()
     elif self.namespace == 'Note':
         note = self.db.get_note_from_gramps_id(gramps_id)
         name = note.get()
     return name
Exemplo n.º 4
0
 def name_from_gramps_id(self, gramps_id):
     if self.namespace == 'Person':
         person = self.db.get_person_from_gramps_id(gramps_id)
         name = _nd.display_name(person.get_primary_name())
     elif self.namespace == 'Family':
         family = self.db.get_family_from_gramps_id(gramps_id)
         name = family_name(family, self.db)
     elif self.namespace == 'Event':
         event = self.db.get_event_from_gramps_id(gramps_id)
         name = str(event.get_type)
     elif self.namespace == 'Place':
         place = self.db.get_place_from_gramps_id(gramps_id)
         name = _pd.display(self.db, place)
     elif self.namespace == 'Source':
         source = self.db.get_source_from_gramps_id(gramps_id)
         name = source.get_title()
     elif self.namespace == 'Citation':
         citation = self.db.get_citation_from_gramps_id(gramps_id)
         name = citation.get_page()
     elif self.namespace == 'Media':
         obj = self.db.get_object_from_gramps_id(gramps_id)
         name = obj.get_path()
     elif self.namespace == 'Repository':
         repo = self.db.get_repository_from_gramps_id(gramps_id)
         name = repo.get_name()
     elif self.namespace == 'Note':
         note = self.db.get_note_from_gramps_id(gramps_id)
         name = note.get()
     return name
Exemplo n.º 5
0
 def get_menu_title(self):
     if self.obj and self.obj.get_handle():
         dialog_title = family_name(self.obj, self.db, _("New Family"))
         dialog_title = _("Family") + ': ' + dialog_title
     else:
         dialog_title = _("New Family")
     return dialog_title
Exemplo n.º 6
0
 def get_menu_title(self):
     if self.obj and self.obj.get_handle():
         dialog_title = family_name(self.obj, self.db, _("New Family"))
         dialog_title = _("Family") + ': ' + dialog_title
     else:
         dialog_title = _("New Family")
     return dialog_title
Exemplo n.º 7
0
def family_event_name(event, family, dbase):
    """
    Build a name for an event based on the family's information.
    """
    if not event.get_description():
        text = EVENT_FAMILY_STR % {
            'event_name' : str(event.get_type()),
            'family' : family_name(family, dbase),
            }
        event.set_description(text)
Exemplo n.º 8
0
 def write_family(self, family_handle):
     family = self.db.get_family_from_handle(family_handle)
     if family:
         for event_ref in family.get_event_ref_list():
             event = self.db.get_event_from_handle(event_ref.ref)
             if event and event.get_type() == EventType.MARRIAGE:
                 # feature requests 2356, 1657: avoid genitive form
                 text = "%s - %s" % (family_name(family,
                                                 self.db), _("Marriage"))
                 self.write_vevent(text, event)
Exemplo n.º 9
0
def family_event_name(event, family, dbase):
    """
    Build a name for an event based on the family's information.
    """
    if not event.get_description():
        text = EVENT_FAMILY_STR % {
            'event_name' : str(event.get_type()),
            'family' : family_name(family, dbase),
            }
        event.set_description(text)
Exemplo n.º 10
0
 def get_obj(self, handle):
     name2 = ""
     if self.namespace == 'Person':
         person = self.db.get_person_from_handle(handle)
         name = name_displayer.sorted(person)
         gid = person.get_gramps_id()
         obj = person
     elif self.namespace == 'Family':
         family = self.db.get_family_from_handle(handle)
         name = family_name(family, self.db)
         gid = family.get_gramps_id()
         obj = family
     elif self.namespace == 'Event':
         event = self.db.get_event_from_handle(handle)
         name = str(event.get_type())
         name2 = event.get_description()
         gid = event.get_gramps_id()
         obj = event
     elif self.namespace == 'Source':
         source = self.db.get_source_from_handle(handle)
         name = source.get_title()
         gid = source.get_gramps_id()
         obj = source
     elif self.namespace == 'Citation':
         citation = self.db.get_citation_from_handle(handle)
         src_handle = citation.get_reference_handle()
         source = self.db.get_source_from_handle(src_handle)
         name = citation.get_page()
         name2 = source.get_title()
         gid = citation.get_gramps_id()
         obj = citation
     elif self.namespace == 'Place':
         place = self.db.get_place_from_handle(handle)
         name = place_displayer.display(self.db, place)
         gid = place.get_gramps_id()
         obj = place
     elif self.namespace == 'Media':
         obj = self.db.get_media_from_handle(handle)
         name = obj.get_description()
         gid = obj.get_gramps_id()
     elif self.namespace == 'Repository':
         repo = self.db.get_repository_from_handle(handle)
         name = repo.get_name()
         gid = repo.get_gramps_id()
         obj = repo
     elif self.namespace == 'Note':
         note = self.db.get_note_from_handle(handle)
         name = note.get().replace('\n', ' ')
         if len(name) > 80:
             name = name[:80]+"..."
         gid = note.get_gramps_id()
         obj = note
     return (gid, name, name2, obj)
Exemplo n.º 11
0
    def dump_family(self, family_handle, generation):
        family = self.db.get_family_from_handle(family_handle)
        family_toc_name = family_name(family, self.db)

        self.doc.start_paragraph('FGR-Title')
        if self.recursive and self.generations:
            title = self._("Family Group Report - Generation %d") % generation
        else:
            title = self._("Family Group Report")
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        mark = IndexMark(family_toc_name, INDEX_TYPE_TOC, 2)
        self.doc.write_text('', mark)
        self.doc.end_paragraph()

        self.dump_parent(self._("Husband"), family.get_father_handle())
        self.doc.start_paragraph("FGR-blank")
        self.doc.end_paragraph()

        if self.inc_par_mar:
            self.dump_marriage(family)
            self.doc.start_paragraph("FGR-blank")
            self.doc.end_paragraph()

        self.dump_parent(self._("Wife"), family.get_mother_handle())

        length = len(family.get_child_ref_list())
        if length > 0:
            self.doc.start_paragraph("FGR-blank")
            self.doc.end_paragraph()
            self.doc.start_table('FGR-Children', 'FGR-ChildTable')
            self.doc.start_row()
            self.doc.start_cell('FGR-ParentHead', 4)
            self.doc.start_paragraph('FGR-ParentName')
            self.doc.write_text(self._("Children"))
            self.doc.end_paragraph()
            self.doc.end_cell()
            self.doc.end_row()
            index = 1
            for child_ref in family.get_child_ref_list():
                self.dump_child(index, child_ref.ref)
                index += 1
            self.doc.end_table()

        if self.recursive:
            for child_ref in family.get_child_ref_list():
                child = self.db.get_person_from_handle(child_ref.ref)
                for child_family_handle in child.get_family_handle_list():
                    if child_family_handle != family_handle:
                        self.doc.page_break()
                        self.dump_family(child_family_handle, (generation+1))
Exemplo n.º 12
0
    def dump_family(self, family_handle, generation):
        family = self.db.get_family_from_handle(family_handle)
        family_toc_name = family_name(family, self.db)

        self.doc.start_paragraph('FGR-Title')
        if self.recursive and self.generations:
            title = self._("Family Group Report - Generation %d") % generation
        else:
            title = self._("Family Group Report")
        mark = IndexMark(title, INDEX_TYPE_TOC, 1)
        self.doc.write_text(title, mark)
        mark = IndexMark(family_toc_name, INDEX_TYPE_TOC, 2)
        self.doc.write_text('', mark)
        self.doc.end_paragraph()

        self.dump_parent(self._("Husband"), family.get_father_handle())
        self.doc.start_paragraph("FGR-blank")
        self.doc.end_paragraph()

        if self.inc_par_mar:
            self.dump_marriage(family)
            self.doc.start_paragraph("FGR-blank")
            self.doc.end_paragraph()

        self.dump_parent(self._("Wife"), family.get_mother_handle())

        length = len(family.get_child_ref_list())
        if length > 0:
            self.doc.start_paragraph("FGR-blank")
            self.doc.end_paragraph()
            self.doc.start_table('FGR-Children', 'FGR-ChildTable')
            self.doc.start_row()
            self.doc.start_cell('FGR-ParentHead', 4)
            self.doc.start_paragraph('FGR-ParentName')
            self.doc.write_text(self._("Children"))
            self.doc.end_paragraph()
            self.doc.end_cell()
            self.doc.end_row()
            index = 1
            for child_ref in family.get_child_ref_list():
                self.dump_child(index, child_ref.ref)
                index += 1
            self.doc.end_table()

        if self.recursive:
            for child_ref in family.get_child_ref_list():
                child = self.db.get_person_from_handle(child_ref.ref)
                for child_family_handle in child.get_family_handle_list():
                    if child_family_handle != family_handle:
                        self.doc.page_break()
                        self.dump_family(child_family_handle, (generation+1))
Exemplo n.º 13
0
 def write_family(self, family_handle):
     family = self.db.get_family_from_handle(family_handle)
     if family:
         for event_ref in family.get_event_ref_list():
             event = self.db.get_event_from_handle(event_ref.ref)
             if event.get_type() == EventType.MARRIAGE:
                 m_date = event.get_date_object()
                 place_handle = event.get_place_handle()
                 # feature requests 2356, 1657: avoid genitive form
                 text = _("Marriage of %s") % family_name(family, self.db)
                 if place_handle:
                     place_title = _pd.display_event(self.db, event)
                     self.write_vevent(text, m_date, place_title)
                 else:
                     self.write_vevent(text, m_date)
Exemplo n.º 14
0
 def write_family(self, family_handle):
     family = self.db.get_family_from_handle(family_handle)
     if family:
         for event_ref in family.get_event_ref_list():
             event = self.db.get_event_from_handle(event_ref.ref)
             if event.get_type() == EventType.MARRIAGE:
                 m_date = event.get_date_object()
                 place_handle = event.get_place_handle()
                 # feature requests 2356, 1657: avoid genitive form
                 text = _("Marriage of %s") % family_name(family, self.db)
                 if place_handle:
                     place_title = _pd.display_event(self.db, event)
                     self.write_vevent( text, m_date, place_title)
                 else:
                     self.write_vevent( text, m_date)
Exemplo n.º 15
0
 def get_name_id(self, handle):
     if self.namespace == 'Person':
         person = self.db.get_person_from_handle(handle)
         name = _nd.sorted(person)
         gid = person.get_gramps_id()
     elif self.namespace == 'Family':
         family = self.db.get_family_from_handle(handle)
         name = family_name(family, self.db)
         gid = family.get_gramps_id()
     elif self.namespace == 'Event':
         event = self.db.get_event_from_handle(handle)
         name = event.get_description()
         gid = event.get_gramps_id()
     elif self.namespace == 'Source':
         source = self.db.get_source_from_handle(handle)
         name = source.get_title()
         gid = source.get_gramps_id()
     elif self.namespace == 'Citation':
         citation = self.db.get_citation_from_handle(handle)
         name = citation.get_page()
         gid = citation.get_gramps_id()
     elif self.namespace == 'Place':
         place = self.db.get_place_from_handle(handle)
         name = _pd.display(self.db, place)
         gid = place.get_gramps_id()
     elif self.namespace == 'Media':
         obj = self.db.get_object_from_handle(handle)
         name = obj.get_description()
         gid = obj.get_gramps_id()
     elif self.namespace == 'Repository':
         repo = self.db.get_repository_from_handle(handle)
         name = repo.get_name()
         gid = repo.get_gramps_id()
     elif self.namespace == 'Note':
         note = self.db.get_note_from_handle(handle)
         name = note.get().replace('\n', ' ')
         if len(name) > 80:
             name = name[:80] + "..."
         gid = note.get_gramps_id()
     return (name, gid)
Exemplo n.º 16
0
 def get_name_id(self, handle):
     if self.namespace == 'Person':
         person = self.db.get_person_from_handle(handle)
         name = _nd.sorted(person)
         gid = person.get_gramps_id()
     elif self.namespace == 'Family':
         family = self.db.get_family_from_handle(handle)
         name = family_name(family, self.db)
         gid = family.get_gramps_id()
     elif self.namespace == 'Event':
         event = self.db.get_event_from_handle(handle)
         name = event.get_description()
         gid = event.get_gramps_id()
     elif self.namespace == 'Source':
         source = self.db.get_source_from_handle(handle)
         name = source.get_title()
         gid = source.get_gramps_id()
     elif self.namespace == 'Citation':
         citation = self.db.get_citation_from_handle(handle)
         name = citation.get_page()
         gid = citation.get_gramps_id()
     elif self.namespace == 'Place':
         place = self.db.get_place_from_handle(handle)
         name = _pd.display(self.db, place)
         gid = place.get_gramps_id()
     elif self.namespace == 'Media':
         obj = self.db.get_media_from_handle(handle)
         name = obj.get_description()
         gid = obj.get_gramps_id()
     elif self.namespace == 'Repository':
         repo = self.db.get_repository_from_handle(handle)
         name = repo.get_name()
         gid = repo.get_gramps_id()
     elif self.namespace == 'Note':
         note = self.db.get_note_from_handle(handle)
         name = note.get().replace('\n', ' ')
         if len(name) > 80:
             name = name[:80]+"..."
         gid = note.get_gramps_id()
     return (name, gid)
Exemplo n.º 17
0
 def sort_val_from_handle(self, handle):
     if self.namespace == 'Person':
         name = self.db.get_person_from_handle(handle).get_primary_name()
         sortname = _nd.sort_string(name)
     elif self.namespace == 'Family':
         sortname = family_name(self.db.get_family_from_handle(handle),
                                self.db)
     elif self.namespace == 'Event':
         sortname = self.db.get_event_from_handle(handle).get_description()
     elif self.namespace == 'Source':
         sortname = self.db.get_source_from_handle(handle).get_title()
     elif self.namespace == 'Citation':
         sortname = self.db.get_citation_from_handle(handle).get_page()
     elif self.namespace == 'Place':
         sortname = self.db.get_place_from_handle(handle).get_title()
     elif self.namespace == 'Media':
         sortname = self.db.get_object_from_handle(handle).get_description()
     elif self.namespace == 'Repository':
         sortname = self.db.get_repository_from_handle(handle).get_name()
     elif self.namespace == 'Note':
         gid = self.db.get_note_from_handle(handle).get_gramps_id()
         sortname = gid
     return (sortname, handle)
Exemplo n.º 18
0
 def sort_val_from_handle(self, handle):
     if self.namespace == 'Person':
         name = self.db.get_person_from_handle(handle).get_primary_name()
         sortname = _nd.sort_string(name)
     elif self.namespace == 'Family':
         sortname = family_name(
             self.db.get_family_from_handle(handle),self.db)
     elif self.namespace == 'Event':
         sortname = self.db.get_event_from_handle(handle).get_description()
     elif self.namespace == 'Source':
         sortname = self.db.get_source_from_handle(handle).get_title()
     elif self.namespace == 'Citation':
         sortname = self.db.get_citation_from_handle(handle).get_page()
     elif self.namespace == 'Place':
         place = self.db.get_place_from_handle(handle)
         sortname = _pd.display(self.db, place)
     elif self.namespace == 'Media':
         sortname = self.db.get_media_from_handle(handle).get_description()
     elif self.namespace == 'Repository':
         sortname = self.db.get_repository_from_handle(handle).get_name()
     elif self.namespace == 'Note':
         gid = self.db.get_note_from_handle(handle).get_gramps_id()
         sortname = gid
     return (sortname, handle)
Exemplo n.º 19
0
    def load_model(self):
        """
        Objects can have very large backreferences. To avoid blocking the 
        interface up to the moment that the model is created, this method is 
        called via GLib.idle_add.
        WARNING: a consequence of above is that loading can still be happening
            while the GUI using this model is no longer used. Disconnect any
            methods before closing the GUI.
        """
        self.loading = True
        self.count = 0
        for ref in self.sref_list:
            self.count += 1
            dtype = ref[0]
            if dtype == 'Person':
                p = self.db.get_person_from_handle(ref[1])
                if not p:
                    continue
                gid = p.gramps_id
                handle = p.handle
                name = name_displayer.display(p)
            elif dtype == 'Family':
                p = self.db.get_family_from_handle(ref[1])
                if not p:
                    continue
                gid = p.gramps_id
                handle = p.handle
                name = family_name(p, self.db)
            elif dtype == 'Source':
                p = self.db.get_source_from_handle(ref[1])
                if not p:
                    continue
                gid = p.gramps_id
                handle = p.handle
                name = p.get_title()
            elif dtype == 'Citation':
                p = self.db.get_citation_from_handle(ref[1])
                if not p:
                    continue
                gid = p.gramps_id
                handle = p.handle
                name = p.get_page()
            elif dtype == 'Event':
                p = self.db.get_event_from_handle(ref[1])
                if not p:
                    continue
                gid = p.gramps_id
                handle = p.handle
                name = p.get_description()
                if name:
                    name = self.dispstr % {
                        'part1': str(p.get_type()),
                        'part2': name
                    }
                else:
                    name = str(p.get_type())
                part = get_participant_from_event(self.db, ref[1])
                if part:
                    name = self.dispstr % {'part1': name, 'part2': part}
            elif dtype == 'Place':
                p = self.db.get_place_from_handle(ref[1])
                if not p:
                    continue
                name = place_displayer.display(self.db, p)
                gid = p.gramps_id
                handle = p.handle
            elif dtype == 'Repository':
                p = self.db.get_repository_from_handle(ref[1])
                if not p:
                    continue
                name = p.get_name()
                gid = p.gramps_id
                handle = p.handle
            else:
                p = self.db.get_object_from_handle(ref[1])
                if not p:
                    continue
                name = p.get_description()
                gid = p.gramps_id
                handle = p.handle

            # dtype is the class name, i.e. is English
            # We need to use localized string in the model.
            # we also need to keep class names to get the object type,
            # but we don't need to show that in the view.
            self.append(row=[_(dtype), gid, name, handle, dtype])
            yield True
        self.loading = False
        yield False
Exemplo n.º 20
0
    def load_model(self):
        """
        Objects can have very large backreferences. To avoid blocking the
        interface up to the moment that the model is created, this method is
        called via GLib.idle_add.
        WARNING: a consequence of above is that loading can still be happening
            while the GUI using this model is no longer used. Disconnect any
            methods before closing the GUI.
        """
        self.loading = True
        self.count = 0
        for ref in self.sref_list:
            self.count += 1
            dtype = ref[0]
            if dtype == 'Person':
                p = self.db.get_person_from_handle(ref[1])
                if not p:
                    continue
                gid = p.gramps_id
                handle = p.handle
                name = name_displayer.display(p)
            elif dtype == 'Family':
                p = self.db.get_family_from_handle(ref[1])
                if not p:
                    continue
                gid = p.gramps_id
                handle = p.handle
                name = family_name(p, self.db)
            elif dtype == 'Source':
                p = self.db.get_source_from_handle(ref[1])
                if not p:
                    continue
                gid = p.gramps_id
                handle = p.handle
                name = p.get_title()
            elif dtype == 'Citation':
                p = self.db.get_citation_from_handle(ref[1])
                if not p:
                    continue
                gid = p.gramps_id
                handle = p.handle
                name = p.get_page()
            elif dtype == 'Event':
                p = self.db.get_event_from_handle(ref[1])
                if not p:
                    continue
                gid = p.gramps_id
                handle = p.handle
                name = p.get_description()
                if name:
                    name = self.dispstr % {'part1': str(p.get_type()),
                                'part2': name}
                else:
                    name = str(p.get_type())
                part = get_participant_from_event(self.db, ref[1])
                if part :
                    name = self.dispstr % {'part1': name,
                                'part2': part}
            elif dtype == 'Place':
                p = self.db.get_place_from_handle(ref[1])
                if not p:
                    continue
                name = place_displayer.display(self.db, p)
                gid = p.gramps_id
                handle = p.handle
            elif dtype == 'Repository':
                p = self.db.get_repository_from_handle(ref[1])
                if not p:
                    continue
                name = p.get_name()
                gid = p.gramps_id
                handle = p.handle
            else:
                p = self.db.get_object_from_handle(ref[1])
                if not p:
                    continue
                name = p.get_description()
                gid = p.gramps_id
                handle = p.handle

            # dtype is the class name, i.e. is English
            # We need to use localized string in the model.
            # we also need to keep class names to get the object type,
            # but we don't need to show that in the view.
            self.append(row=[_(dtype), gid, name, handle, dtype])
            yield True
        self.loading = False
        yield False