added basic view of which files were matched with which people

This commit is contained in:
2021-01-22 21:14:17 +11:00
parent ea48900564
commit 42b4880b62
2 changed files with 15 additions and 2 deletions

5
ai.py
View File

@@ -5,10 +5,13 @@ from main import db, app, ma
from sqlalchemy import Sequence from sqlalchemy import Sequence
from sqlalchemy.exc import SQLAlchemyError from sqlalchemy.exc import SQLAlchemyError
from status import st, Status from status import st, Status
from files import Entry, File
from person import File_Person_Link
################################################################################ ################################################################################
# /aistats -> placholder for some sort of stats # /aistats -> placholder for some sort of stats
################################################################################ ################################################################################
@app.route("/aistats", methods=["GET", "POST"]) @app.route("/aistats", methods=["GET", "POST"])
def aistats(): 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)

View File

@@ -1,5 +1,15 @@
{% extends "base.html" %} {% extends "base.html" %}
{% block main_content %} {% block main_content %}
<h3>Placeholder</h3> <h3>Basic AI stats</h3>
<table class="table table-striped table-sm">
<tbody><thead class="thead-light"><tr><th>File</th><th>AI Matched people</th></thead>
{% for e in entries %}
<tr><td>{{e.name}}</td><td>
{% for p in e.file_details[0].people %}
{{p.tag}}
{% endfor %}
</td></tr>
{% endfor %}
</tbody></table>
{% endblock main_content %} {% endblock main_content %}