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:
2021-01-25 01:05:30 +11:00
parent 0829a98376
commit 18b8a30140
9 changed files with 108 additions and 89 deletions

View File

@@ -17,13 +17,13 @@ class Refimg(db.Model):
def __repr__(self):
return "<id: {}, fname: {}>".format(self.id, self.fname )
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)
#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)
################################################################################
# Helper class that inherits a .dump() method to turn class Refimg into json / useful in jinja2