Esempio n. 1
0
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})
Esempio n. 2
0
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') 
Esempio n. 3
0
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})
Esempio n. 4
0
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})