-
Notifications
You must be signed in to change notification settings - Fork 0
/
category.py
31 lines (25 loc) · 898 Bytes
/
category.py
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
31
from product import Product
class Category():
"""! The Category Class"""
def __init__(self,categoryID:str, categoryDesc:str, productList):
"""! The initialiser
@param categoryID category id
@param categoryDesc category description
@param productList list of product
"""
self.categoryID = categoryID
self.categoryDesc = categoryDesc
self.productList = productList
def countProduct():
"""! get the amount of products in the category"""
pass
def getProductList():
"""! get a list of products"""
pass
if __name__ == '__main__':
p1 = Product(101, 'Retro Skateboard', 20.00, 1)
p2 = Product(102, 'Swim Seat', 15.00, 1)
productList = []
productList.append(p1) #传入到购物车的是list
productList.append(p2)
c = Category('c001', '雅思噶', productList)