From d17834ecd099eb99b9f92077edaac41d790cdeab Mon Sep 17 00:00:00 2001 From: bytesparallel Date: Thu, 3 Feb 2022 13:53:43 -0600 Subject: [PATCH] correcting factory objects --- views/animal_requests.py | 2 +- views/customer_requests.py | 6 +++--- views/employees_requests.py | 8 +++----- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/views/animal_requests.py b/views/animal_requests.py index 776dc28..2e506b4 100644 --- a/views/animal_requests.py +++ b/views/animal_requests.py @@ -1,6 +1,6 @@ import sqlite3 import json -from models import Animal +from models.animal import Animal def get_all_animals(): # Open a connection to the database diff --git a/views/customer_requests.py b/views/customer_requests.py index 19c6dd3..a157259 100644 --- a/views/customer_requests.py +++ b/views/customer_requests.py @@ -33,9 +33,9 @@ def get_all_customers(): # Note that the database fields are specified in # exact order of the parameters defined in the # Animal class above. - customer = Customer(row['id'], row['name'], row['breed'], - row['status'], row['location_id'], - row['customer_id']) + customer = Customer(row['id'], row['name'], row['address'], + row['email'], row['password'], + ) customers.append(customer.__dict__) diff --git a/views/employees_requests.py b/views/employees_requests.py index fa65d33..e51a97a 100644 --- a/views/employees_requests.py +++ b/views/employees_requests.py @@ -1,5 +1,6 @@ import sqlite3 import json +from models.employee import Employee def get_all_employees(): # Open a connection to the database @@ -15,8 +16,7 @@ def get_all_employees(): e.id, e.name, e.address, - e.email, - e.password, + e.location_id FROM employee e """) @@ -33,9 +33,7 @@ def get_all_employees(): # Note that the database fields are specified in # exact order of the parameters defined in the # Animal class above. - employee = Employee(row['id'], row['name'], row['breed'], - row['status'], row['location_id'], - row['employee_id']) + employee = Employee(row['id'], row['name'], row['address'],row['location_id']) employees.append(employee.__dict__)