chiark / gitweb /
Added list by number of children; refarctored other list-by-count
[familyTree.git] / cgiFiles / listAge.py
index b0b40914beaf26d1a0325b988834c5cdd558eee1..e1a8d61b7580c628e13f1b58c479d02188572aed 100755 (executable)
@@ -10,16 +10,26 @@ import everyPage
 
 [conn,form]=everyPage.top()
 
-result = 1
-if result == None:
-        everyPage.bad()
-else:   
+age = form.getvalue('age')
+if age == None:
         printMe = askQuestion.count_age_at_child('<br>')
         if len(printMe)<3:
                 printMe =  'sorry, no data <br>'
 
         everyPage.good(printMe)
 
+else:
+       result = re.match('[-]{0,1}[0-9]{1,4}$', str(age))
+
+       if result == None:
+               everyPage.bad()
+       else:
+               printMe  = askQuestion.people_had_child_at_age(age,'<br>')
+               if len(printMe)<10:
+                       printMe =  'sorry, no data <br>'
+
+                       everyPage.good(printMe)
+
 
 everyPage.bottom(conn)