Signup page now populates database correctly
This commit is contained in:
@ -6,8 +6,11 @@ class Customer(User):
|
||||
|
||||
No additional properties are assigned to the customer
|
||||
'''
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
def __init__(self, id: int, username: str, email: str, firstname: str,
|
||||
lastname: str, phone: str, password: str, role: str):
|
||||
super().__init__(
|
||||
id, username, email, firstname, lastname, phone, password, role
|
||||
)
|
||||
|
||||
def login(self):
|
||||
print("Logging in as Customer")
|
||||
|
@ -1,18 +1,19 @@
|
||||
from abc import ABC, abstractmethod
|
||||
|
||||
class User(ABC):
|
||||
'''
|
||||
Class constructor to instatiate the base object
|
||||
'''
|
||||
def __init__(self):
|
||||
self.id = 0
|
||||
self.username = ""
|
||||
self.email = ""
|
||||
self.firstName = ""
|
||||
self.lastName = ""
|
||||
self.phone = ""
|
||||
self.password = ""
|
||||
self.role=""
|
||||
""" Functional Class constructor to initialise all properties in the base object
|
||||
with a value """
|
||||
def __init__(self, id: int, username: str, email: str, firstname: str,
|
||||
lastname: str, phone: str, password: str, role: str):
|
||||
self.id = id
|
||||
self.username = username
|
||||
self.email = email
|
||||
self.firstName = firstname
|
||||
self.lastName = lastname
|
||||
self.phone = phone
|
||||
self.password = password
|
||||
self.role= role
|
||||
|
||||
|
||||
@abstractmethod
|
||||
def login(self):
|
||||
|
Reference in New Issue
Block a user