Moved fallback functions from Db to gen.utils
svn: r13876
This commit is contained in:
@@ -166,30 +166,6 @@ def find_marriage(database, family):
|
||||
return event
|
||||
return None
|
||||
|
||||
def get_birth_or_fallback(database, person):
|
||||
birth_ref = person.get_birth_ref()
|
||||
if birth_ref: # regular birth found
|
||||
return database.get_event_from_handle(birth_ref.ref)
|
||||
# now search the event list for fallbacks
|
||||
for event_ref in person.get_primary_event_ref_list():
|
||||
event = database.get_event_from_handle(event_ref.ref)
|
||||
if (event.type.is_birth_fallback() and
|
||||
event_ref.role.is_primary()):
|
||||
return event
|
||||
return None
|
||||
|
||||
def get_death_or_fallback(database, person):
|
||||
death_ref = person.get_death_ref()
|
||||
if death_ref: # regular death found
|
||||
return database.get_event_from_handle(death_ref.ref)
|
||||
# now search the event list for fallbacks
|
||||
for event_ref in person.get_primary_event_ref_list():
|
||||
event = database.get_event_from_handle(event_ref.ref)
|
||||
if (event.type.is_death_fallback() and
|
||||
event_ref.role.is_primary()):
|
||||
return event
|
||||
return None
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# Indexing function
|
||||
|
||||
Reference in New Issue
Block a user