added reference image class, also tweaked DB classes to have foreign keys, so you cant delete a person connected to a file (tested). Also made refimg class do some quirky bootstrap/jquery to get file dialogs not looking like crap

This commit is contained in:
2021-01-12 23:58:12 +11:00
parent a3a95f636e
commit ed3a85b8f0
4 changed files with 105 additions and 6 deletions

11
main.py
View File

@@ -30,6 +30,17 @@ Bootstrap(app)
from settings import Settings
from files import Files
from person import Person
from refimg import Refimg
from ai import *
####################################### CLASSES / DB model #######################################
class Person_Refimg_Link(db.Model):
__tablename__ = "person_refimg_link"
person_id = db.Column(db.Integer, db.ForeignKey('person.id'), unique=True, nullable=False, primary_key=True)
refimg_id = db.Column(db.Integer, db.ForeignKey('refimg.id'), unique=True, nullable=False, primary_key=True)
def __repr__(self):
return "<person_id: {}, refimg_id>".format(self.person_id, self.refimg_id)
####################################### GLOBALS #######################################
# allow jinja2 to call these python functions directly