class PyramidPool(db.Model): __tablename__ = 'pyr' sku_num = db.Column('SKU_NUM', db.String(50), primary_key=True) attr_nm = db.Column('ATTR_NM', db.Text, primary_key=True) web_cls_num = db.Column('WEB_CLASS_NUM', db.Integer) web_cls_nm = db.Column('WEB_CLASS', db.String(255)) item_desc = db.Column('ITEM_DESC', db.Text) attr_val = db.Column('ATTR_VAL', db.Text)
class Job(db.Model): job_id = db.Column(db.Integer, primary_key=True) crc_id = db.Column(db.String(63), unique=True, nullable=False) user_id = db.Column(db.String(63)) date_added = db.Column(db.DateTime) no_of_titles = db.Column(db.Integer) title = db.Column(db.String(256)) year = db.Column(db.String(4)) video_type = db.Column(db.String(20)) imdb_id = db.Column(db.String(15)) tmdb_id = db.Column(db.String(15)) omdb_id = db.Column(db.String(15)) hasnicetitle = db.Column(db.Boolean) disctype = db.Column(db.String(20)) # dvd/bluray/data/music/unknown label = db.Column(db.String(256)) validated = db.Column(db.Boolean) def __init__(self, crc, title, year): """Return a disc object""" self.crc_id = crc self.title = title self.year = year self.hasnicetitle = False self.video_type = "unknown" self.date_added = datetime.datetime.now() def __str__(self): """Returns a string of the object""" s = self.__class__.__name__ + ": " for attr, value in self.__dict__.items(): s = s + "(" + str(attr) + "=" + str(value) + ") " return s def get_d(self): r = {} for key, value in self.__dict__.items(): if '_sa_instance_state' not in key and "user_id" not in key: r[str(key)] = str(value) return r def __repr__(self): return '<Job {}>'.format(self.label)
class Review(db.Model): __tablename__ = 'match_review' id = db.Column('id', db.Integer, primary_key=True, autoincrement=True) sku_num = db.Column('SKU_NUM', db.String(50)) item_desc = db.Column('ITEM_DESC', db.Text) attr_nm = db.Column('ATTR_NM', db.Text) attr_val = db.Column('ATTR_VAL', db.Text) attr_val_rev = db.Column('ATTR_VAL_Reviewed', db.Text, default=None) date_created = db.Column('Creation_Date', db.DateTime, nullable=False) web_cls_num = db.Column('WEB_CLASS_NUM', db.Integer) def __repr__(self): return f'Review("{self.id}")'
class ApiKeys(db.Model): user_id = db.Column(db.Integer, primary_key=True) key = db.Column(db.String(256), unique=True) def __init__(self, key): """Return a disc object""" self.key = key def __str__(self): """Returns a string of the object""" return "" def __repr__(self): return '<Job {}>'.format(self.user_id)