From b472d6a8b1443de941feb9b6649be2d338b932e3 Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sun, 24 Jan 2016 09:55:11 -0500 Subject: [PATCH] Family: define extra secondary fields, and indexes --- gramps/gen/lib/family.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/gramps/gen/lib/family.py b/gramps/gen/lib/family.py index d4d10c096..afc45a152 100644 --- a/gramps/gen/lib/family.py +++ b/gramps/gen/lib/family.py @@ -257,6 +257,28 @@ class Family(CitationBase, NoteBase, MediaBase, AttributeBase, LdsOrdBase, "father_given": "father_handle.primary_name.first_name", } + @classmethod + def get_extra_secondary_fields(cls): + """ + Return a list of full field names and types for secondary + fields that are not directly listed in the schema. + """ + return [ + ("father_handle.primary_name.surname_list.0.surname", str), + ("father_handle.primary_name.first_name", str), + ("mother_handle.primary_name.surname_list.0.surname", str), + ("mother_handle.primary_name.first_name", str), + ] + + @classmethod + def get_index_fields(cls): + return [ + "father_handle.primary_name.surname_list.0.surname", + "father_handle.primary_name.first_name", + "mother_handle.primary_name.surname_list.0.surname", + "mother_handle.primary_name.first_name", + ] + def unserialize(self, data): """ Convert the data held in a tuple created by the serialize method