chiark / gitweb /
list people who had children at given age; good for finding errors
authornaath <naath@chiark.greenend.org.uk>
Sun, 6 Apr 2014 12:28:23 +0000 (13:28 +0100)
committernaath <naath@chiark.greenend.org.uk>
Sun, 6 Apr 2014 12:28:23 +0000 (13:28 +0100)
familyTree/askQuestion.py
familyTree/notes

index f5cfa244551164a44f69d6fcb43f45fcb4332fda..6e9642635213f84bc4ac330d7f71103bdaadd63f 100755 (executable)
@@ -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"\
index 014f328125519429f959f2feeb9b904b3d012757..eee79691acd0e9a1c22a4a831e07ed740caf8d69 100644 (file)
@@ -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.
+