moved class Refimg to person, and ditched all other routes/direct access to ref images, they are only a part of Person in UI now
This commit is contained in:
11
person.py
11
person.py
@@ -5,7 +5,6 @@ from main import db, app, ma
|
||||
from sqlalchemy import Sequence
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
from status import st, Status
|
||||
from refimg import Refimg
|
||||
from flask_login import login_required, current_user
|
||||
from werkzeug import secure_filename
|
||||
from shared import GenFace, GenThumb
|
||||
@@ -18,6 +17,16 @@ import os
|
||||
################################################################################
|
||||
# Class describing Person in the database, and via sqlalchemy, connected to the DB as well
|
||||
################################################################################
|
||||
class Refimg(db.Model):
|
||||
id = db.Column(db.Integer, db.Sequence('refimg_id_seq'), primary_key=True )
|
||||
fname = db.Column(db.String(256), unique=True, nullable=False)
|
||||
face = db.Column(db.LargeBinary, unique=True, nullable=False)
|
||||
thumbnail = db.Column(db.String, unique=True, nullable=False)
|
||||
created_on = db.Column(db.Float)
|
||||
|
||||
def __repr__(self):
|
||||
return "<id: {}, fname: {}>".format(self.id, self.fname )
|
||||
|
||||
class PersonRefimgLink(db.Model):
|
||||
__tablename__ = "person_refimg_link"
|
||||
person_id = db.Column(db.Integer, db.ForeignKey('person.id'), unique=True, nullable=False, primary_key=True)
|
||||
|
||||
Reference in New Issue
Block a user