Updated line endings to be in line with UNIX style
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
class Category:
|
||||
'''
|
||||
Constructor for a category object
|
||||
'''
|
||||
|
||||
def __init__(self):
|
||||
self.id = 0
|
||||
self.name = ""
|
||||
class Category:
|
||||
'''
|
||||
Constructor for a category object
|
||||
'''
|
||||
|
||||
def __init__(self):
|
||||
self.id = 0
|
||||
self.name = ""
|
||||
|
@@ -1,15 +1,15 @@
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class Order:
|
||||
'''
|
||||
Constructor for an order object
|
||||
'''
|
||||
|
||||
def __init__(self):
|
||||
self.id = 0
|
||||
self.sellerID = 0
|
||||
self.customerID = 0
|
||||
self.products = list()
|
||||
self.totalCost = 0.0
|
||||
self.orderDate = datetime.now()
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class Order:
|
||||
'''
|
||||
Constructor for an order object
|
||||
'''
|
||||
|
||||
def __init__(self):
|
||||
self.id = 0
|
||||
self.sellerID = 0
|
||||
self.customerID = 0
|
||||
self.products = list()
|
||||
self.totalCost = 0.0
|
||||
self.orderDate = datetime.now()
|
||||
|
@@ -1,14 +1,14 @@
|
||||
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()
|
||||
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()
|
||||
|
@@ -1,38 +1,38 @@
|
||||
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
|
||||
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
|
||||
|
@@ -1,15 +1,15 @@
|
||||
from .user import User
|
||||
|
||||
|
||||
class Admin(User):
|
||||
'''
|
||||
Class constructor to instatiate an admin object
|
||||
|
||||
No additional properties are assigned to the admin
|
||||
'''
|
||||
|
||||
def __init__(self, username: str, password: str, firstname: str,
|
||||
lastname: str, email: str, phone: str):
|
||||
super().__init__(
|
||||
username, password, firstname, lastname, email, phone, "Admin"
|
||||
)
|
||||
from .user import User
|
||||
|
||||
|
||||
class Admin(User):
|
||||
'''
|
||||
Class constructor to instatiate an admin object
|
||||
|
||||
No additional properties are assigned to the admin
|
||||
'''
|
||||
|
||||
def __init__(self, username: str, password: str, firstname: str,
|
||||
lastname: str, email: str, phone: str):
|
||||
super().__init__(
|
||||
username, password, firstname, lastname, email, phone, "Admin"
|
||||
)
|
||||
|
@@ -1,15 +1,15 @@
|
||||
from .user import User
|
||||
|
||||
|
||||
class Customer(User):
|
||||
'''
|
||||
Class constructor to instatiate a customer object
|
||||
|
||||
No additional properties are assigned to the customer
|
||||
'''
|
||||
|
||||
def __init__(self, username: str, password: str, firstname: str,
|
||||
lastname: str, email: str, phone: str):
|
||||
super().__init__(
|
||||
username, password, firstname, lastname, email, phone, "Customer"
|
||||
)
|
||||
from .user import User
|
||||
|
||||
|
||||
class Customer(User):
|
||||
'''
|
||||
Class constructor to instatiate a customer object
|
||||
|
||||
No additional properties are assigned to the customer
|
||||
'''
|
||||
|
||||
def __init__(self, username: str, password: str, firstname: str,
|
||||
lastname: str, email: str, phone: str):
|
||||
super().__init__(
|
||||
username, password, firstname, lastname, email, phone, "Customer"
|
||||
)
|
||||
|
@@ -1,16 +1,16 @@
|
||||
from .user import User
|
||||
|
||||
|
||||
class Seller(User):
|
||||
'''
|
||||
Class constructor to instatiate a customer object
|
||||
|
||||
No additional properties are assigned to the customer
|
||||
'''
|
||||
|
||||
def __init__(self, username: str, password: str, firstname: str,
|
||||
lastname: str, email: str, phone: str):
|
||||
super().__init__(
|
||||
username, password, firstname, lastname, email, phone, "Seller"
|
||||
)
|
||||
self.store = ""
|
||||
from .user import User
|
||||
|
||||
|
||||
class Seller(User):
|
||||
'''
|
||||
Class constructor to instatiate a customer object
|
||||
|
||||
No additional properties are assigned to the customer
|
||||
'''
|
||||
|
||||
def __init__(self, username: str, password: str, firstname: str,
|
||||
lastname: str, email: str, phone: str):
|
||||
super().__init__(
|
||||
username, password, firstname, lastname, email, phone, "Seller"
|
||||
)
|
||||
self.store = ""
|
||||
|
@@ -1,20 +1,20 @@
|
||||
from abc import ABC
|
||||
|
||||
|
||||
class User(ABC):
|
||||
""" Functional Class constructor to initialise all properties in
|
||||
the base object with a value
|
||||
"""
|
||||
|
||||
def __init__(self, username: str, password: str,
|
||||
firstname: str, lastname: str,
|
||||
email: str, phone: str, role: str
|
||||
):
|
||||
self.id = 0
|
||||
self.username = username
|
||||
self.password = password
|
||||
self.firstName = firstname
|
||||
self.lastName = lastname
|
||||
self.email = email
|
||||
self.phone = phone
|
||||
self.role = role
|
||||
from abc import ABC
|
||||
|
||||
|
||||
class User(ABC):
|
||||
""" Functional Class constructor to initialise all properties in
|
||||
the base object with a value
|
||||
"""
|
||||
|
||||
def __init__(self, username: str, password: str,
|
||||
firstname: str, lastname: str,
|
||||
email: str, phone: str, role: str
|
||||
):
|
||||
self.id = 0
|
||||
self.username = username
|
||||
self.password = password
|
||||
self.firstName = firstname
|
||||
self.lastName = lastname
|
||||
self.email = email
|
||||
self.phone = phone
|
||||
self.role = role
|
||||
|
Reference in New Issue
Block a user