Basic template
This commit is contained in:
parent
bd63ae9a4d
commit
6bceef1664
9 changed files with 66 additions and 0 deletions
20
app/models.py
Normal file
20
app/models.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from app import db
|
||||
|
||||
|
||||
class Item(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
title = db.Column(db.String(250))
|
||||
description = db.Column(db.Text)
|
||||
price = db.Column(db.Float)
|
||||
bought = db.Column(db.Boolean)
|
||||
|
||||
|
||||
class Wishlist(db.Model):
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
editId = db.Column(db.Uuid)
|
||||
viewId = db.Column(db.Uuid)
|
||||
title = db.Column(db.String(250))
|
||||
description = db.Column(db.Text)
|
||||
|
||||
itemIds = db.Column(db.ARRAY(db.Integer)) # Store item IDs as an array
|
||||
items = db.relationship("Item", primaryjoin="Wishlist.itemIds")
|
||||
Loading…
Add table
Add a link
Reference in a new issue