Beispiel #1
0
 def post(self):
   emp = Employee(firstname=self.request.get('firstname'), 
                  lastname=self.request.get('lastname'), 
                  department_ref=Department.get(self.request.get('department_key')))
       
   emp.put()
   self.redirect('/employee')
Beispiel #2
0
 def get(self):
   emp = Employee.get(self.request.get('key'))
   deps = Department.all()
   values = {
             'emp': emp,
             'deps': deps
             }
   self.response.out.write(template.render('templates/editemployee.html', values))
Beispiel #3
0
 def post(self):
   emp = Employee.get(self.request.get('key'))
   emp.firstname = self.request.get('firstname') 
   emp.lastname = self.request.get('lastname')
   
   dep = Department.get(self.request.get('department_key'))
   emp.department_ref = dep
   emp.put()
   
   message = 'Changes saved' 
   deps = Department.all()
   values = {
             'emp': emp,
             'deps': deps,
             'message': message
             }
   
   self.response.out.write(template.render('templates/editemployee.html', values))
Beispiel #4
0
 def get(self):
   emp = Employee.get(self.request.get('key'))
   emp.delete()
   self.redirect('/employee')