Added the ability to add a reference image to a person, and connect the two in the db
This commit is contained in:
@@ -16,6 +16,14 @@ 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)
|
||||
|
||||
################################################################################
|
||||
# Helper class that inherits a .dump() method to turn class Refimg into json / useful in jinja2
|
||||
|
||||
Reference in New Issue
Block a user