Ejemplo n.º 1
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))
Ejemplo n.º 2
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))