-
Notifications
You must be signed in to change notification settings - Fork 0
/
US18_SiblingsnotMarry.py
31 lines (28 loc) · 1.03 KB
/
US18_SiblingsnotMarry.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from datetime import datetime, timedelta
from datetime import datetime
from dateutil.relativedelta import relativedelta
#from collections import counter
import re
import sys
import pymongo
from pymongo import MongoClient
from pprint import pprint
from all_db_operations import *
from print_data import *
connection = MongoClient('localhost', 27017)
db = connection['GEDCOMDB']
def siblingsnotmarry():
userStoryName('US18')
results = get_family()
indi = get_people()
for res in results:
if "CHILDREN" in res:
child = res['CHILDREN']
childd = list( x for x in indi if x["ID"] in child)
#print childd
for sibling in childd:
sib_fam = next((x for x in results if x["HUSBAND"] == sibling["ID"]),None)
#print sib_fam
if sib_fam and sib_fam["WIFE"] in child:
message = "Sibling is married to another sibling"
save_invalid_family_for_print(sib_fam["FAMID"], "US18", message)