2023-12-31 16:27:39 +00:00
|
|
|
from datetime import datetime
|
|
|
|
|
2024-01-05 18:20:56 +00:00
|
|
|
class Product:
|
2023-12-31 16:27:39 +00:00
|
|
|
'''
|
|
|
|
Base class for a product
|
|
|
|
'''
|
|
|
|
def __init__(self):
|
2024-01-05 18:20:56 +00:00
|
|
|
self.id = 0
|
2023-12-31 16:27:39 +00:00
|
|
|
self.name = ""
|
2024-01-05 18:20:56 +00:00
|
|
|
self.image = "/static/assets/wmgzon.png"
|
|
|
|
self.description = ""
|
2023-12-31 16:27:39 +00:00
|
|
|
self.cost = 0.0
|
2024-01-10 23:44:59 +00:00
|
|
|
self.category = 0
|
2023-12-31 16:27:39 +00:00
|
|
|
self.sellerID = 0
|
|
|
|
self.postedDate = datetime.now()
|
|
|
|
self.quantityAvailable = 0
|
2024-01-10 23:44:59 +00:00
|
|
|
|
|
|
|
'''
|
|
|
|
Class constructor to instatiate a customer object
|
|
|
|
|
|
|
|
No additional properties are assigned to the customer
|
|
|
|
'''
|
|
|
|
def __init__(self, name: str, image: str, description: str, cost: float, category: int,
|
|
|
|
seller_id: int, posted_date: datetime, quantity_available: int):
|
|
|
|
self.id = 0
|
|
|
|
self.name = name
|
|
|
|
self.image = image
|
|
|
|
self.description = description
|
|
|
|
self.cost = cost
|
|
|
|
self.category = category
|
|
|
|
self.sellerID = seller_id
|
|
|
|
self.postedDate = posted_date
|
|
|
|
self.quantityAvailable = quantity_available
|
2024-01-05 18:20:56 +00:00
|
|
|
|