class OwnedCard(db.Model): __bind_key__ = 'portfolio_mtg' id = db.Column(db.Integer(), primary_key=True) owner = db.Column(db.String()) clean_name = db.Column(db.String()) product_id = db.Column(db.String()) group_id = db.Column(db.String()) quantity_regular = db.Column(db.String()) quantity_foil = db.Column(db.String()) def __init__(self, owner='', clean_name='', product_id='', group_id='', quantity_regular='', quantity_foil=''): self.owner = owner self.clean_name = clean_name self.product_id = product_id self.group_id = group_id self.quantity_regular = quantity_regular self.quantity_foil = quantity_foil def __repr__(self): return f"{self.clean_name}"
class AuthToken(db.Model): __bind_key__ = 'portfolio_mtg' id = db.Column(db.Integer(), primary_key=True) token = db.Column(db.String()) expiration_date = db.Column(db.String()) def __init__(self, token='', expiration_date=''): self.token = token self.expiration_date = expiration_date
class LastFullUpdate(db.Model): __bind_key__ = 'portfolio_mtg' id = db.Column(db.Integer(), primary_key=True) last_push = db.Column(db.String()) def __init__(self, last_push=''): self.last_push = last_push def __repr__(self): return f"{self.last_push}"
class CardValue(db.Model): __bind_key__ = 'portfolio_mtg' id = db.Column(db.Integer(), primary_key=True) product_id = db.Column(db.String()) value_regular = db.Column(db.String()) value_foil = db.Column(db.String()) last_update = db.Column(db.String()) def __init__(self, product_id='', value_regular='', value_foil='', last_update=''): self.product_id = product_id self.value_regular = value_regular self.value_foil = value_foil self.last_update = last_update def __repr__(self): return f"{self.product_id}"
class MagicCard(db.Model): __bind_key__ = 'portfolio_mtg' id = db.Column(db.Integer(), primary_key=True) product_id = db.Column(db.String(), index=True) name = db.Column(db.String(), index=True) clean_name = db.Column(db.String(), index=True) image_url = db.Column(db.String()) category_id = db.Column(db.String()) group_id = db.Column(db.String()) tgc_url = db.Column(db.String()) modified_on = db.Column(db.String()) rarity = db.Column(db.String()) def __init__(self, product_id='', name='', clean_name='', image_url='', category_id='', group_id='', tgc_url='', modified_on='', rarity='', card_number=''): self.product_id = product_id self.name = name self.clean_name = clean_name self.image_url = image_url self.category_id = category_id self.group_id = group_id self.tgc_url = tgc_url self.modified_on = modified_on self.rarity = rarity def __repr__(self): return f"{self.name}"