def edit(request,mykey):
    form= Employeeprofileform()
    employee=Employeeprofile.get(mykey)
    import pdb; pdb.set_trace()
    if request.POST:
form= Employeeprofileform(request.POST)
                if form.is_valid():
   employee.employee_name =form.cleaned_data['employee_name']
   employee.employee_number=form.cleaned_data['employee_number']
   employee.employee_email = form.cleaned_data['employee_email']
   employee.employee_mobilenumber= 
form.cleaned_data['employee_mobilenumber']
   employee.employee_address = form.cleaned_data['employee_address']
   employee.put()
                   return HttpResponseRedirect("/listallemployees/")
                else:
   return render_to_response('main/create.html', {'form': form})
                   
    else:
                data={'employee_name':employee.employee_name, 
'employee_number': employee.employee_number,'employee_email': 
employee.employee_email,'employee_mobilenumber':employee.employee_mobilenumber,'employee_address':
 
employee.employee_address}
                form= Employeeprofileform(data)
return render_to_response('main/edit.html', {'form': form})
    


it always results in creation of new entity why?....
Thanks in advance....

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine/-/uBXuSiMM6i8J.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to