Beispiel #1
0
 def post(self, request, *args, **kwargs):
     try:
         instance = Mentorship.objects.get(id=request.POST['mid'])
         form=MentorshipForm(request.POST,instance=instance)
         mentor = form.save(commit=False)
         
         mentor.save()
         msg="Record saved"
     except:
         msg="Unable to process, Please check all values are present"
     return HttpResponse(json.dumps(dict(result=msg)), content_type="application/json")
Beispiel #2
0
    def post(self, request, *args, **kwargs):
        try:
            instance = Mentorship.objects.get(id=request.POST['mid'])
            form = MentorshipForm(request.POST, instance=instance)
            mentor = form.save(commit=False)

            mentor.save()
            msg = "Record saved"
        except:
            msg = "Unable to process, Please check all values are present"
        return HttpResponse(json.dumps(dict(result=msg)),
                            content_type="application/json")
Beispiel #3
0
    def post(self, request, *args, **kwargs):

        form = MentorshipForm(request.POST)
        mentorship = form.save(commit=True)
        return HttpResponseRedirect('/admin/mentors')
Beispiel #4
0
	def post(self, request, *args, **kwargs):
        	
        	
            	form=MentorshipForm(request.POST)
            	mentorship = form.save(commit=True)
            	return HttpResponseRedirect('/admin/mentors')