insert name keys for indexing

svn: r6817
This commit is contained in:
Brian Matherly
2006-05-30 01:18:41 +00:00
parent fe55f54624
commit 8ebd09eabb
4 changed files with 73 additions and 22 deletions

View File

@ -226,9 +226,10 @@ class DetDescendantReport(Report.Report):
self.doc.start_paragraph("DDR-First-Entry","%s." % val)
name = _nd.display_formal(person)
pkey = ReportUtils.get_person_key(self.database, person)
self.doc.start_bold()
self.doc.write_text(name)
self.doc.write_text(name,pkey)
if name[-1:] == '.':
self.doc.write_text(" ")
else:
@ -369,19 +370,27 @@ class DetDescendantReport(Report.Report):
if mother_handle:
mother = self.database.get_person_from_handle(mother_handle)
mother_name = _nd.display_name(mother.get_primary_name())
mother_key = ReportUtils.get_person_key(self.database, mother)
else:
mother_name = ""
mother_key = ""
if father_handle:
father = self.database.get_person_from_handle(father_handle)
father_name = _nd.display_name(father.get_primary_name())
father_key = ReportUtils.get_person_key(self.database, father)
else:
father_name = ""
father_key = ""
text = ReportUtils.child_str(person, father_name, mother_name,
bool(person.get_death_ref()),
firstName)
if text:
self.doc.write_text(text)
if father_key != "":
self.doc.write_text("",father_key)
if mother_key != "":
self.doc.write_text("",mother_key)
def write_marriage(self, person):
"""
@ -394,6 +403,7 @@ class DetDescendantReport(Report.Report):
spouse = self.database.get_person_from_handle(spouse_handle)
marriage_event = ReportUtils.find_marriage(self.database,family)
text = ""
spouse_key = ReportUtils.get_person_key(self.database, spouse)
if marriage_event:
text = ReportUtils.married_str(self.database,person,spouse,
marriage_event,self.endnotes,
@ -403,7 +413,7 @@ class DetDescendantReport(Report.Report):
text = ReportUtils.married_rel_str(self.database,person,family,
is_first)
if text:
self.doc.write_text(text)
self.doc.write_text(text,spouse_key)
is_first = False
def write_children(self, family):
@ -437,6 +447,7 @@ class DetDescendantReport(Report.Report):
child_handle = child_ref.ref
child = self.database.get_person_from_handle(child_handle)
child_name = _nd.display(child)
child_key = ReportUtils.get_person_key(self.database,child)
if self.childRef and self.prev_gen_handles.get(child_handle):
value = str(self.prev_gen_handles.get(child_handle))
@ -448,9 +459,10 @@ class DetDescendantReport(Report.Report):
if self.henry.has_key(child_handle):
self.doc.write_text("%s [%s]. " % (child_name,
self.henry[child_handle]))
self.henry[child_handle]),
child_key )
else:
self.doc.write_text("%s. " % child_name)
self.doc.write_text("%s. " % child_name,child_Key)
self.doc.write_text(ReportUtils.born_str(
self.database, child, 0, self.EMPTY_DATE, self.EMPTY_PLACE))
@ -465,6 +477,7 @@ class DetDescendantReport(Report.Report):
family = self.database.get_family_from_handle(family_handle)
person_name = ""
ind_handle = None
person_key = ""
if mate.get_gender() == RelLib.Person.MALE:
ind_handle = family.get_mother_handle()
else:
@ -472,6 +485,7 @@ class DetDescendantReport(Report.Report):
if ind_handle:
ind = self.database.get_person_from_handle(ind_handle)
person_name = _nd.display(ind)
person_key = ReportUtils.get_person_key(self.database,ind)
firstName = ReportUtils.common_name(ind,self.usenick)
else:
firstName = 0
@ -479,7 +493,7 @@ class DetDescendantReport(Report.Report):
if person_name:
self.doc.start_paragraph("DDR-Entry")
self.doc.write_text(person_name)
self.doc.write_text(person_name,person_key)
text = ReportUtils.born_str(self.database,ind,"",
self.EMPTY_DATE,self.EMPTY_PLACE)