Changeset - 7893c279fbd8
[Not reviewed]
0 1 0
Lance Edgar (lance) - 12 years ago 2012-07-31 16:12:40
lance@edbob.org
add Product.subdepartment relationship
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rattail/db/extension/model.py
Show inline comments
 
@@ -584,24 +584,26 @@ class Product(Base):
 

	
 
    __tablename__ = 'products'
 

	
 
    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))
 
    description2 = Column(String(60))
 
    size = Column(String(30))
 
    regular_price = Column(Numeric(10,4))
 
    package_price = Column(Numeric(10,4))
 
    package_price_quantity = Column(Integer)
 
    sale_price = Column(Numeric(10,4))
 
    sale_price_quantity = Column(Integer)
 

	
 
    department = relationship(Department)
 
    subdepartment = relationship(Subdepartment)
 
    category = relationship(Category)
 
    brand = relationship(Brand)
 

	
 
    def __repr__(self):
 
        return "<Product: %s>" % self.description
 

	
0 comments (0 inline, 0 general)