From 7893c279fbd8f6d0b7bde5f5e3e27245c8a9c5ca 2012-07-31 16:12:40 From: Lance Edgar Date: 2012-07-31 16:12:40 Subject: [PATCH] add Product.subdepartment relationship --- diff --git a/rattail/db/extension/model.py b/rattail/db/extension/model.py index 2b34feddcbc7ed34b5e619550adb954594deaa63..9e4c2934433a6a2033be114c85a24ffb82fe4442 100644 --- a/rattail/db/extension/model.py +++ b/rattail/db/extension/model.py @@ -587,6 +587,7 @@ class Product(Base): uuid = uuid_column() upc = Column(BigInteger, index=True) department_uuid = Column(String(32), ForeignKey('departments.uuid')) + subdepartment_uuid = Column(String(32), ForeignKey('subdepartments.uuid')) category_uuid = Column(String(32), ForeignKey('categories.uuid')) brand_uuid = Column(String(32), ForeignKey('brands.uuid')) description = Column(String(60)) @@ -599,6 +600,7 @@ class Product(Base): sale_price_quantity = Column(Integer) department = relationship(Department) + subdepartment = relationship(Subdepartment) category = relationship(Category) brand = relationship(Brand)