-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve out_of_stock_item SQLAlchemy model compliance #3
- Loading branch information
Showing
1 changed file
with
5 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") |