WMGZON/models/products/product.py

37 lines
1001 B
Python

from datetime import datetime
class Product:
'''
Base class for a product
'''
def __init__(self):
self.id = 0
self.name = ""
self.image = "/static/assets/wmgzon.png"
self.description = ""
self.cost = 0.0
self.category = 0
self.sellerID = 0
self.postedDate = datetime.now()
self.quantityAvailable = 0
'''
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