Beispiel #1
0
 def post(self, request, *args, **kwargs):
     try:
         instance = OdList.objects.get(id=request.POST['id'])
         form=OdForm(request.POST,instance=instance)
         odlist = form.save(commit=False)
         odlist.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 = OdList.objects.get(id=request.POST['id'])
         form = OdForm(request.POST, instance=instance)
         odlist = form.save(commit=False)
         odlist.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 get(self, request, *args, **kwargs):
     _od_id = args[0]
     odObj = OdList.objects.filter(id=_od_id)
     od = odObj.values()[0]
     od['id'] = mentObj[0].id
     od['staff'] = mentObj[0].staff.id
     form = OdForm(od)
     print form
     return render(request, self.template_name, {'form': form})
Beispiel #4
0
 def post(self, request, *args, **kwargs):
     form = OdForm(request.POST)
     odlist = form.save(commit=True)
     return HttpResponseRedirect('/admin/Od/')
Beispiel #5
0
	def post(self, request, *args, **kwargs):
            form=OdForm(request.POST)
            odlist = form.save(commit=True)
            return HttpResponseRedirect('/admin/Od/')