From 42b4880b627f518c29621462fc506cbd32727883 Mon Sep 17 00:00:00 2001 From: Damien De Paoli Date: Fri, 22 Jan 2021 21:14:17 +1100 Subject: [PATCH] added basic view of which files were matched with which people --- ai.py | 5 ++++- templates/aistats.html | 12 +++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ai.py b/ai.py index 3f1a5c5..82938af 100644 --- a/ai.py +++ b/ai.py @@ -5,10 +5,13 @@ from main import db, app, ma from sqlalchemy import Sequence from sqlalchemy.exc import SQLAlchemyError from status import st, Status +from files import Entry, File +from person import File_Person_Link ################################################################################ # /aistats -> placholder for some sort of stats ################################################################################ @app.route("/aistats", methods=["GET", "POST"]) def aistats(): - return render_template("aistats.html", page_title='Placeholder') + entries=db.session.query(Entry).join(File).join(File_Person_Link).filter(File_Person_Link.file_id==File.eid).all() + return render_template("aistats.html", page_title='Placeholder', entries=entries) diff --git a/templates/aistats.html b/templates/aistats.html index 985119a..4a2e503 100644 --- a/templates/aistats.html +++ b/templates/aistats.html @@ -1,5 +1,15 @@ {% extends "base.html" %} {% block main_content %} -

Placeholder

+

Basic AI stats

+ + + {% for e in entries %} + + {% endfor %} +
FileAI Matched people
{{e.name}} + {% for p in e.file_details[0].people %} + {{p.tag}} + {% endfor %} +
{% endblock main_content %}