Skip to content

Commit

Permalink
add product variant
Browse files Browse the repository at this point in the history
  • Loading branch information
David Rasch committed Jul 6, 2015
1 parent ed395ea commit 3fbd5a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -59,4 +59,5 @@ target/
# project specific
app/static/libs/*
.module-cache/
node_modules/
node_modules/
test.db
12 changes: 12 additions & 0 deletions rfs/products/models.py
Expand Up @@ -5,3 +5,15 @@ class Product(db.Model):
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(512), nullable=False)
description = db.Column(db.Text)
image = db.Column(db.String(512))

class ProductVariant(db.model)
id = db.Column(db.Integer, primary_key=True)
title = db.Column(db.String(512), nullable=False)
description = db.Column(db.Text)
sku = db.Column(db.String(512))
price = db.Column(db.Integer))
inventory = db.Column(db.Integer))

mainproduct_id = db.Column(Integer, ForeignKey('products.id'))
mainproduct = relationship("Product", backref=backref('varients', order_by=id))

0 comments on commit 3fbd5a7

Please sign in to comment.