diff --git a/app/routes.py b/app/routes.py index 9a13e2b..3de1a2c 100644 --- a/app/routes.py +++ b/app/routes.py @@ -7,7 +7,7 @@ from flask import Blueprint, abort, render_template, request, send_from_director from peewee import * from .app import APPPATH -from .modeles import Institution, State, House, Intervention_type, Production_place, Diplo_type, Document, Acte, Individual, Involved_in +from .modeles import Institution, State, House, Intervention_type, Production_place, Diplo_type, Document, Agent, Acte, Transcribed_by, Individual, Involved_in RESULT_PAR_PAGES = 5 @@ -77,13 +77,21 @@ def acte(house=None, prince=None, acte_id=None): q_prod = Involved_in.select().where( (Involved_in.involved_in_prince == prince) &(Involved_in.invol_in_interv == 1)) - q_acte = Acte.select().where( - Acte.filename == acte_id) + q_acte = Acte.select().where(Acte.filename == acte_id) for t in q_acte: + acte_number = t.id_acte acte_place_id = t.prod_place_acte acte_doc = t.doc_acte acte_state_id = t.state_doc acte_diplo_type = t.diplo_type_acte + + + q_agent = [t.agent_name for t in Agent.select().where( + Agent.id_agent == + [t.transcr_agent for t in Transcribed_by.select().where( + Transcribed_by.transcr_acte == acte_number)][0])] + transcriber = q_agent[0] + place = [t.placename for t in Production_place.select().where( Production_place.id_place == acte_place_id)] diplo_t = [t.diplo_label for t in Diplo_type.select().where( @@ -120,7 +128,8 @@ def acte(house=None, prince=None, acte_id=None): return render_template("acte.html", house=house, prince=prince, infos=q_acte, place=place[0], doc=doc[0][0], arch=inst[0], diplo=diplo_t[0].replace("_", " "), state=state[0], - output_doc=output_doc, name_prince=prince_name[0]) + output_doc=output_doc, name_prince=prince_name[0], + transcriber=transcriber) @main.route("/contact") def contact() -> t.Text: diff --git a/app/templates/acte.html b/app/templates/acte.html index c7e7a78..1f657cd 100644 --- a/app/templates/acte.html +++ b/app/templates/acte.html @@ -17,5 +17,6 @@
{{state}}, {{diplo}}, {{arch}}, {{doc}}, {{item.ref_acte}}.
{% endfor %}--> {{output_doc|safe}} +Transcription : {{transcriber}}.
{% endblock %} \ No newline at end of file