-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
30 lines (28 loc) · 889 Bytes
/
models.py
File metadata and controls
30 lines (28 loc) · 889 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"""
This is for product
represent products' information in store
"""
class Product:
# Our products name price and qunatitiy
def __init__(self, name:str, price:float, stock:int):
'''
initialize a product
showing the information of each product in the shop
arguments:
name -> str, price -> float, stock -> int
'''
self.name = name
self.price = price
self.stock = stock
"""
This is for cartItem
represent and holding an available item with number of purchase in the box
"""
class CartItem:
"""
Initialize a cart item
product -> obj, quantitiy -> int
"""
def __init__(self,product:Product,quantity:int) -> None:
self.product = product
self.quantity = quantity