fix(import): align child-parent pedigree mapping by using name cell row for vertical alignment
This commit is contained in:
@@ -882,17 +882,29 @@ def main():
|
||||
m_dob = parse_date(mother_ref.get("dob"))
|
||||
|
||||
for p_cand in stammbaum_only_animals:
|
||||
p_gender = str(p_cand.get("gender") or "").lower().strip()
|
||||
if p_gender in ["w", "f", "female", "weiblich"]:
|
||||
continue
|
||||
p_dob = parse_date(p_cand.get("dob"))
|
||||
if dob_val and p_dob and p_dob >= dob_val:
|
||||
continue
|
||||
cand_call_norm = normalize_name(get_call_name(p_cand["name"])) or "unbekannt"
|
||||
cand_name_norm = normalize_name(p_cand["name"]) or "unbekannt"
|
||||
if cand_call_norm == normalize_name(f_name) or cand_name_norm == normalize_name(f_name):
|
||||
if not f_dob or parse_date(p_cand.get("dob")) == f_dob:
|
||||
if not f_dob or p_dob == f_dob:
|
||||
f_scoped_id = generate_guid(f"stammbaum-animal-{p_cand['id']}")
|
||||
break
|
||||
for p_cand in stammbaum_only_animals:
|
||||
p_gender = str(p_cand.get("gender") or "").lower().strip()
|
||||
if p_gender in ["m", "male", "männlich"]:
|
||||
continue
|
||||
p_dob = parse_date(p_cand.get("dob"))
|
||||
if dob_val and p_dob and p_dob >= dob_val:
|
||||
continue
|
||||
cand_call_norm = normalize_name(get_call_name(p_cand["name"])) or "unbekannt"
|
||||
cand_name_norm = normalize_name(p_cand["name"]) or "unbekannt"
|
||||
if cand_call_norm == normalize_name(m_name) or cand_name_norm == normalize_name(m_name):
|
||||
if not m_dob or parse_date(p_cand.get("dob")) == m_dob:
|
||||
if not m_dob or p_dob == m_dob:
|
||||
m_scoped_id = generate_guid(f"stammbaum-animal-{p_cand['id']}")
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user