Skip to content

Commit

Permalink
Improve out_of_stock_item SQLAlchemy model compliance #3
Browse files Browse the repository at this point in the history
  • Loading branch information
xanode committed Oct 25, 2022
1 parent dedd5db commit 502b7ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions backend/app/models/out_of_stock_item.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
from sqlalchemy import Boolean, Column, Integer, String
from sqlalchemy import Boolean, Column, Enum, Integer, String
from sqlalchemy.orm import relationship

from app.core.types import IconName
from app.db.base_class import Base


class OutOfStockItem(Base):
id = Column(Integer, primary_key=True, nullable=False)
buy_or_sell = Column(Boolean, nullable=False) # True means buy, False means sell
name = Column(String, nullable=False)
sale = Column(Boolean, nullable=False) # True is selling, False is buying
icon = Column(Enum(IconName), nullable=False)
sell_price = Column(Integer, nullable=True)

outofstocks = relationship("OutOfStock", back_populates="item")

0 comments on commit 502b7ae

Please sign in to comment.