Created a set of base models to begin fleshing out the data aspect of the application
This commit is contained in:
0
models/products/__init__.py
Normal file
0
models/products/__init__.py
Normal file
13
models/products/carpart.py
Normal file
13
models/products/carpart.py
Normal file
@ -0,0 +1,13 @@
|
||||
from product import Product
|
||||
|
||||
class CarPart(Product):
|
||||
'''
|
||||
Constructor for a car part
|
||||
|
||||
Contains additional information that is only relevant for car parts
|
||||
'''
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.make = ""
|
||||
self.compatibleVehicles = list()
|
||||
|
22
models/products/product.py
Normal file
22
models/products/product.py
Normal file
@ -0,0 +1,22 @@
|
||||
from abc import ABC
|
||||
from datetime import datetime
|
||||
|
||||
class Product(ABC):
|
||||
'''
|
||||
Base class for a product
|
||||
'''
|
||||
def __init__(self):
|
||||
self.productID = 0
|
||||
self.name = ""
|
||||
self.cost = 0.0
|
||||
self.category = ""
|
||||
self.sellerID = 0
|
||||
self.postedDate = datetime.now()
|
||||
self.quantityAvailable = 0
|
||||
|
||||
def addToBasket():
|
||||
pass
|
||||
|
||||
def buyProduct():
|
||||
pass
|
||||
|
Reference in New Issue
Block a user