Add ProductUser
model
This commit is contained in:
parent
6ecfbf4e1a
commit
acc85ba8de
|
@ -410,6 +410,51 @@ class ProductFlag(Base):
|
||||||
return self.description or ''
|
return self.description or ''
|
||||||
|
|
||||||
|
|
||||||
|
class ProductUser(Base):
|
||||||
|
"""
|
||||||
|
Represents extended "user" info for a product (e.g. sale signage).
|
||||||
|
"""
|
||||||
|
__tablename__ = 'productUser'
|
||||||
|
|
||||||
|
upc = sa.Column(sa.String(length=13), primary_key=True, nullable=False)
|
||||||
|
product = orm.relationship(
|
||||||
|
Product,
|
||||||
|
primaryjoin=Product.upc == upc,
|
||||||
|
foreign_keys=[upc],
|
||||||
|
doc="""
|
||||||
|
Reference to the :class:`Product` to which this record applies.
|
||||||
|
""",
|
||||||
|
backref=orm.backref(
|
||||||
|
'user_info',
|
||||||
|
uselist=False,
|
||||||
|
doc="""
|
||||||
|
Reference to the :class:`ProductUser` record for this product, if any.
|
||||||
|
"""))
|
||||||
|
|
||||||
|
description = sa.Column(sa.String(length=255), nullable=True)
|
||||||
|
|
||||||
|
brand = sa.Column(sa.String(length=255), nullable=True)
|
||||||
|
|
||||||
|
sizing = sa.Column(sa.String(length=255), nullable=True)
|
||||||
|
|
||||||
|
photo = sa.Column(sa.String(length=255), nullable=True)
|
||||||
|
|
||||||
|
# TODO: this was not in some older DBs
|
||||||
|
# nutrition_facts = sa.Column('nutritionFacts', sa.String(length=255), nullable=True)
|
||||||
|
|
||||||
|
long_text = sa.Column(sa.Text(), nullable=True)
|
||||||
|
|
||||||
|
enable_online = sa.Column('enableOnline', sa.Boolean(), nullable=True)
|
||||||
|
|
||||||
|
sold_out = sa.Column('soldOut', sa.Boolean(), nullable=True, default=False)
|
||||||
|
|
||||||
|
# TODO: this was not in some older DBs
|
||||||
|
# sign_count = sa.Column('signCount', sa.SmallInteger(), nullable=True, default=1)
|
||||||
|
|
||||||
|
# TODO: this was not in some older DBs
|
||||||
|
# narrow = sa.Column(sa.Boolean(), nullable=True, default=False)
|
||||||
|
|
||||||
|
|
||||||
class VendorItem(Base):
|
class VendorItem(Base):
|
||||||
"""
|
"""
|
||||||
Represents a "source" for a given item, from a given vendor.
|
Represents a "source" for a given item, from a given vendor.
|
||||||
|
|
Loading…
Reference in a new issue