changing the saved contents of the model , edit model fileds once saved

Posted by imran-glt on Stack Overflow See other posts from Stack Overflow or by imran-glt
Published on 2010-06-10T22:40:31Z Indexed on 2010/06/10 22:42 UTC
Read the original article Hit count: 252

Filed under:

hi

I have extended the user model and added extra fields to it i.e "latitude" "longitude" and status and than save it. up to here it works fine. but i want to allow the user to change his/her "latitude" "longitude" whenever he/she needs like the hotmail and yahoo allows change account feature. in my case the user only wants to chage the latitude and longitude i tried it in this way but it didnt work. is this the right way to do it ...... or is there any other way to change the saved contents

view.py

def status_change(request):

     print "status_change function called"
     if request.method == "POST":
    rform = registerForm(data = request.POST)
uform = UserForm(data = request.POST)
     if rform.is_valid():
        user = uform.save()
        register = rform.save()
            register.user = user
            register.save()
                return render_to_response('home.html')
else:
    rform = registerForm() 
return render_to_response('status_change.html',{'rform':rform}) 

© Stack Overflow or respective owner

Related posts about django-models