This is my edit profile function in view

def edit_profile(request):      
    if 'username' in request.session:
        user_id=request.POST.get('id')
        user_id=request.GET.get('id')
        usr_obj=User.objects.get(id=int(user_id))
        if request.method=="POST":
                regform=Registration(instance=usr_obj,data = request.POST)
                if regform.is_valid():
                    regform.save();
                    return HttpResponseRedirect('/index/')
                else:
                    return 
render_to_response("edit_profile.html",{"form":regform,})
        else:       
            user_id=request.GET.get('id')
            usr_obj=User.objects.get(id=int(user_id))
     
#temp_data={'first_name':user_id.first_name,'last_name':user_id.last_name,'email':user_id.email,'password':user_id.password,'dob':user_id.dob,'mobileno':user_id.mobileno,'houseno':user_id.houseno,'address1':user_id.address1,'city':user_id.city,'state':user_id.state,'pincode':user_id.pincode,'country':user_id.country,'comment':user_id.comment,'sex':user_id.sex}
            regform=Registration(instance=usr_obj)
            return 
render_to_response("edit_profile.html",{"form":regform,"user_id":user_id})


-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/dc65c1d1-62dd-4cfe-b957-ec4b5b1278e9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to