From e62f4173c3c1e22269244dacdd7ee4a5c0bdbc42 Mon Sep 17 00:00:00 2001 From: naath Date: Sun, 6 Apr 2014 13:28:23 +0100 Subject: [PATCH] list people who had children at given age; good for finding errors --- familyTree/askQuestion.py | 22 ++++++++++++++++++++++ familyTree/notes | 6 ++++++ 2 files changed, 28 insertions(+) diff --git a/familyTree/askQuestion.py b/familyTree/askQuestion.py index f5cfa24..6e96426 100755 --- a/familyTree/askQuestion.py +++ b/familyTree/askQuestion.py @@ -271,6 +271,28 @@ def count_age_at_child(newLine): out = print_query(s,(),newLine) return out +def people_had_child_at_age(age,newLine): + + s = "select p1.bornYear - p2.bornYear as age, p1.name, p1.ID"\ + +",p2.name,p2.ID FROM"\ + +" parents INNER JOIN people p1"\ + +" ON parents.ID = p1.ID"\ + +" INNER JOIN people p2"\ + +" ON parents.parentID = p2.ID"\ + +" WHERE age = ?" + + t = (int(age),) + + out = '' + out = 'At age ' + str(age) + ' :' + for row in run_query(s,t): + out = out + newLine + out =out + name_html([row[3],row[4]],newLine) + ' had '\ + +name_html([row[1],row[2]],newLine) + + return out + + def all_ancestors(personID,newLine): #find parents s = "SELECT people.Name,parents.parentID FROM"\ diff --git a/familyTree/notes b/familyTree/notes index 014f328..eee7969 100644 --- a/familyTree/notes +++ b/familyTree/notes @@ -7,3 +7,9 @@ Deal with Consorts, this means including DATES OF MARRIAGE AND DIVORCE ELEANOR OF CASTILE has the WRONG PARENTS!!!! +check others with bad age-at-child numbers +edmund tudor's birth year is wrong + + +territories - some numbers got in there. + -- 2.30.2