Added probably_alive logic
svn: r11552
This commit is contained in:
parent
71ab854115
commit
f017a5020f
@ -42,7 +42,7 @@ from gen.plug.menu import (BooleanOption, EnumeratedListOption,
|
|||||||
from ReportBase import Report, ReportUtils, MenuReportOptions, \
|
from ReportBase import Report, ReportUtils, MenuReportOptions, \
|
||||||
CATEGORY_TEXT
|
CATEGORY_TEXT
|
||||||
from gen.plug import PluginManager
|
from gen.plug import PluginManager
|
||||||
from gen.lib import EventType
|
from Utils import probably_alive
|
||||||
|
|
||||||
MODE_GUI = PluginManager.REPORT_MODE_GUI
|
MODE_GUI = PluginManager.REPORT_MODE_GUI
|
||||||
MODE_BKI = PluginManager.REPORT_MODE_BKI
|
MODE_BKI = PluginManager.REPORT_MODE_BKI
|
||||||
@ -58,10 +58,13 @@ MODE_CLI = PluginManager.REPORT_MODE_CLI
|
|||||||
#------------------------------------------------------------------------
|
#------------------------------------------------------------------------
|
||||||
|
|
||||||
def _good_date(date):
|
def _good_date(date):
|
||||||
if RecordsReportOptions.REGULAR_DATES_ONLY:
|
if date:
|
||||||
return date.is_regular()
|
if RecordsReportOptions.REGULAR_DATES_ONLY:
|
||||||
|
return date.is_regular()
|
||||||
|
else:
|
||||||
|
return date.is_valid()
|
||||||
else:
|
else:
|
||||||
return date.is_valid()
|
return False
|
||||||
|
|
||||||
def _find_death_date(db, person):
|
def _find_death_date(db, person):
|
||||||
death_ref = person.get_death_ref()
|
death_ref = person.get_death_ref()
|
||||||
@ -124,9 +127,10 @@ def _find_records(db, filter, callname):
|
|||||||
name = _person_get_display_name(person, callname)
|
name = _person_get_display_name(person, callname)
|
||||||
|
|
||||||
if death_date is None:
|
if death_date is None:
|
||||||
# Still living, look for age records
|
if probably_alive(person, db):
|
||||||
_record(person_youngestliving, person_oldestliving,
|
# Still living, look for age records
|
||||||
today_date - birth_date, name, 'Person', person_handle)
|
_record(person_youngestliving, person_oldestliving,
|
||||||
|
today_date - birth_date, name, 'Person', person_handle)
|
||||||
elif _good_date(death_date):
|
elif _good_date(death_date):
|
||||||
# Already died, look for age records
|
# Already died, look for age records
|
||||||
_record(person_youngestdied, person_oldestdied,
|
_record(person_youngestdied, person_oldestdied,
|
||||||
@ -253,9 +257,10 @@ def _find_records(db, filter, callname):
|
|||||||
|
|
||||||
if not divorce and not father_death_date and not mother_death_date:
|
if not divorce and not father_death_date and not mother_death_date:
|
||||||
# Still married and alive
|
# Still married and alive
|
||||||
_record(family_youngestmarried, family_oldestmarried,
|
if probably_alive(father, db) and probably_alive(mother, db):
|
||||||
today_date - marriage_date,
|
_record(family_youngestmarried, family_oldestmarried,
|
||||||
name, 'Family', family_handle)
|
today_date - marriage_date,
|
||||||
|
name, 'Family', family_handle)
|
||||||
else:
|
else:
|
||||||
end = None
|
end = None
|
||||||
if father_death_date and mother_death_date:
|
if father_death_date and mother_death_date:
|
||||||
|
Loading…
Reference in New Issue
Block a user