Fixed BUG-11: we have changed to file_refimg_link table (from file_person_link), this means we now have some optimisations, and can definitely re-run AI jobs without crashing. Several optims could still be done - see TODO
This commit is contained in:
15
ai.py
15
ai.py
@@ -5,13 +5,22 @@ 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
|
||||
from files import Entry, File, FileRefimgLink
|
||||
from person import Person, PersonRefimgLink
|
||||
from refimg import Refimg
|
||||
|
||||
################################################################################
|
||||
# /aistats -> placholder for some sort of stats
|
||||
################################################################################
|
||||
@app.route("/aistats", methods=["GET", "POST"])
|
||||
def aistats():
|
||||
entries=db.session.query(Entry).join(File).join(File_Person_Link).filter(File_Person_Link.file_id==File.eid).all()
|
||||
tmp=db.session.query(Entry,Person).join(File).join(FileRefimgLink).join(Refimg).join(PersonRefimgLink).join(Person).filter(FileRefimgLink.matched==True).all()
|
||||
entries=[]
|
||||
last_fname=""
|
||||
for e, p in tmp:
|
||||
if last_fname != e.name:
|
||||
entry = { 'name': e.name, 'people': [] }
|
||||
entries.append( entry )
|
||||
last_fname = e.name
|
||||
entry['people'].append( { 'tag': p.tag } )
|
||||
return render_template("aistats.html", page_title='Placeholder', entries=entries)
|
||||
|
||||
Reference in New Issue
Block a user