order ai stats, and remember to put a container div in for formatting
This commit is contained in:
2
ai.py
2
ai.py
@@ -21,7 +21,7 @@ from face import Face, FaceFileLink, FaceRefimgLink
|
||||
@app.route("/aistats", methods=["GET", "POST"])
|
||||
@login_required
|
||||
def aistats():
|
||||
stats = db.session.execute( "select p.tag, count(f.id) from person p, face f, face_file_link ffl, face_refimg_link frl, person_refimg_link prl where p.id = prl.person_id and prl.refimg_id = frl.refimg_id and frl.face_id = ffl.face_id and ffl.face_id = f.id group by p.tag" )
|
||||
stats = db.session.execute( "select p.tag, count(f.id) from person p, face f, face_file_link ffl, face_refimg_link frl, person_refimg_link prl where p.id = prl.person_id and prl.refimg_id = frl.refimg_id and frl.face_id = ffl.face_id and ffl.face_id = f.id group by p.tag order by 2 desc" )
|
||||
cnt_res = db.session.execute( "select count(1) from ( select p.tag from person p, face f, face_file_link ffl, face_refimg_link frl, person_refimg_link prl where p.id = prl.person_id and prl.refimg_id = frl.refimg_id and frl.face_id = ffl.face_id and ffl.face_id = f.id group by p.tag ) as foo" )
|
||||
num_stats=cnt_res.first()[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user