|
|
|
@ -206,7 +206,11 @@ def _create_transcribed_by(folder: str)-> None:
|
|
|
|
Transcribed_by.create(**data)
|
|
|
|
Transcribed_by.create(**data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def _create_indiv(list_csv):
|
|
|
|
def _create_indiv(list_csv)-> None:
|
|
|
|
|
|
|
|
"""create table indiv with lists made with function __csv_indiv_infos (see below)
|
|
|
|
|
|
|
|
:param list_csv: list of individuals of the same type (secretaries or princes)
|
|
|
|
|
|
|
|
:type list_csv: str
|
|
|
|
|
|
|
|
"""
|
|
|
|
individuals = [{"name_indiv": actor[0], "role_indiv": actor[1],
|
|
|
|
individuals = [{"name_indiv": actor[0], "role_indiv": actor[1],
|
|
|
|
"house_indiv": [t.id_house for t in House.select().where(
|
|
|
|
"house_indiv": [t.id_house for t in House.select().where(
|
|
|
|
House.house_label == actor[2])][0],
|
|
|
|
House.house_label == actor[2])][0],
|
|
|
|
@ -216,6 +220,7 @@ def _create_indiv(list_csv):
|
|
|
|
Individual.create(**data)
|
|
|
|
Individual.create(**data)
|
|
|
|
|
|
|
|
|
|
|
|
def __grape_indiv(list_person, role: str):
|
|
|
|
def __grape_indiv(list_person, role: str):
|
|
|
|
|
|
|
|
""" ?????? """
|
|
|
|
for persons in list_person:
|
|
|
|
for persons in list_person:
|
|
|
|
for person_tag in persons.find_all("person"):
|
|
|
|
for person_tag in persons.find_all("person"):
|
|
|
|
person_text = person_tag.text.replace("\n", "")
|
|
|
|
person_text = person_tag.text.replace("\n", "")
|
|
|
|
@ -272,6 +277,13 @@ def _create_involved_in(folder: str):
|
|
|
|
Involved_in.create(**data)
|
|
|
|
Involved_in.create(**data)
|
|
|
|
|
|
|
|
|
|
|
|
def __csv_indiv_infos(indiv_type):
|
|
|
|
def __csv_indiv_infos(indiv_type):
|
|
|
|
|
|
|
|
"""extract individuals of the same type from static/csv/actors.csv
|
|
|
|
|
|
|
|
and make a list with them
|
|
|
|
|
|
|
|
:param indiv_type: <secret> or <prince>
|
|
|
|
|
|
|
|
:type indiv_type: str
|
|
|
|
|
|
|
|
:return: list of individuals of the choosen type
|
|
|
|
|
|
|
|
:rtype: list
|
|
|
|
|
|
|
|
"""
|
|
|
|
with open(os.path.join(APPPATH, "static", "csv", "actors.csv"), 'r', encoding="utf-8") as opening:
|
|
|
|
with open(os.path.join(APPPATH, "static", "csv", "actors.csv"), 'r', encoding="utf-8") as opening:
|
|
|
|
actors_csv = csv.reader(opening, delimiter=";")
|
|
|
|
actors_csv = csv.reader(opening, delimiter=";")
|
|
|
|
next(actors_csv, None)
|
|
|
|
next(actors_csv, None)
|
|
|
|
|