def getEmployee(self): emp = Employee.getByCredential("sam", "hunt") print emp if emp != None: print emp.username print emp.password print emp.employee_id
def login(self): if request.method == 'POST': print('This standard output', file=sys.stdout) username = request.form['username'] password = request.form['password'] print('got data', file=sys.stdout) print(username + " " + password) registered_user = Employee.getByCredential(username, password) if registered_user is None: flash('Username or Password is invalid', 'error') print('F**k', file=sys.stdout) return redirect('/') print('Got this shit', file=sys.stdout) session['user_type'] = "Employee" login_user(registered_user) print("logged IN") print(current_user) flash('Logged in successfully') return redirect('/calendar') return PageController().index()
def updateEmployee(self): emp = Employee.getByCredential("saam", "hunt") emp.username = "******" Employee.update(emp)
def deleteEmployee(self): emp = Employee.getByCredential("sam", "hunt") print emp if emp != None: print emp.username Employee.delete(emp)