|
|
|
|
@ -219,17 +219,6 @@ def _create_indiv(list_csv)-> None:
|
|
|
|
|
for data in tqdm(individuals, desc="Populating Individual..."):
|
|
|
|
|
Individual.create(**data)
|
|
|
|
|
|
|
|
|
|
def __grape_indiv(list_person, role: str):
|
|
|
|
|
""" ?????? """
|
|
|
|
|
for persons in list_person:
|
|
|
|
|
for person_tag in persons.find_all("person"):
|
|
|
|
|
person_text = person_tag.text.replace("\n", "")
|
|
|
|
|
if person_text != "None":
|
|
|
|
|
prince_q = [t.id_indiv for t in Individual.select().where(
|
|
|
|
|
Individual.name_indiv == person_text)]
|
|
|
|
|
# duke_q = [t.id_duke for t in Duke.select().where(
|
|
|
|
|
# Duke.indiv_duke == prince_q[0])]
|
|
|
|
|
print(person_text, "==", prince_q[0])
|
|
|
|
|
|
|
|
|
|
def _create_involved_in(folder: str):
|
|
|
|
|
"""create involved in table
|
|
|
|
|
@ -320,6 +309,18 @@ def __find_indiv(folder: str, role: str)-> None:
|
|
|
|
|
indiv_lst.append(person.text.replace("\n", ""))
|
|
|
|
|
return set(indiv_lst)
|
|
|
|
|
|
|
|
|
|
def __grape_indiv(list_person, role: str):
|
|
|
|
|
""" ?????? """
|
|
|
|
|
for persons in list_person:
|
|
|
|
|
for person_tag in persons.find_all("person"):
|
|
|
|
|
person_text = person_tag.text.replace("\n", "")
|
|
|
|
|
if person_text != "None":
|
|
|
|
|
prince_q = [t.id_indiv for t in Individual.select().where(
|
|
|
|
|
Individual.name_indiv == person_text)]
|
|
|
|
|
# duke_q = [t.id_duke for t in Duke.select().where(
|
|
|
|
|
# Duke.indiv_duke == prince_q[0])]
|
|
|
|
|
print(person_text, "==", prince_q[0])
|
|
|
|
|
|
|
|
|
|
@db_cli.command()
|
|
|
|
|
def init() -> None:
|
|
|
|
|
"""Initialization of the database"""
|
|
|
|
|
|