def create_employee(cursor, row): _row = sqlite3.Row(cursor, row) employee = Employee() employee.id = _row['id'] employee.first_name = _row['first_name'] employee.last_name = _row['last_name'] employee.dept_name = _row['dept_name'] if _row['model'] is not None: employee.computer = _row['manufacturer'] + ' ' + _row['model'] else: employee.computer = "Not Assigned" employee.start_date = _row['start_date'] employee.is_supervisor = _row['is_supervisor'] if _row["training"] is not None: employee.training = _row["training"] else: employee.training = "Not Assigned" employee.trainings = [] return (employee, )
def create_employee(cursor, row): _row = sqlite3.Row(cursor, row) employee = Employee() employee.id = _row["employee_id"] employee.first_name = _row["first_name"] employee.last_name = _row["last_name"] employee.start_date = _row["start_date"] employee.department_id = _row["department_id"] employee.is_supervisor = _row["is_supervisor"] department = Department() department.id = _row["department_id"] department.dept_name = _row["dept_name"] computer = Computer() computer.manufacturer = _row["manufacturer"] computer.make = _row["make"] computer.id = _row["computer_id"] # training_program = TrainingProgram() # training_program.title = _row["title"] employee.department = department employee.computer = computer # employee.training_program = training_program return employee
def create_employee(cursor, row): _row = sqlite3.Row(cursor, row) e = Employee() e.id = _row["id"] e.first_name = _row["first_name"] e.last_name = _row["last_name"] d = Department() d.name = _row["department"] c = Computer() c.id = _row["computer_id"] c.make = _row["computer"] e.department = d e.computer = c return e