def userupdate(up, si): t = UsrRg.objects.get(id=si) if up.method == "POST": d = Userupdate(up.POST, instance=t) if d.is_valid(): d.save() return redirect('/showdata') d = Userupdate(instance=t) return render(up, 'html/updateuser.html', {'us': d})
def userupdate(up,si): t=UsrRg.objects.get(id=si) h=NewData.objects.get(pid_id=si) if up.method=="POST": d=Userupdate(up.POST,instance=t) k=NewUsrForm(up.POST,instance=h) if d.is_valid(): and k.is_valid() d.save() return redirect('/showdata')
def userupdate(self,si): t=UsrRg.objects.get(id=si) if self.method=="POST": d=Userupdate(self.POST,instance=t) if d.is_valid(): d.save() return redirect('/showdata') d=Userupdate(instance=t) return render(self,'html/userupdate.html',{'p':d})
def userupdate(up, si): t = UsrRg.objects.get(id=si) y = NewData.objects.get(pid_id=si) if up.method == "POST": d = Userupdate(up.POST, instance=t) k = NewUsrForm(up.POST, instance=y) if d.is_valid() and k.is_valid(): d.save() k.save() return redirect('/showdata') d = Userupdate(instance=t) k = NewUsrForm() return render(up, 'html/updateuser.html', {'us': d, 'nt': k})