django - Setting Primary key in ModelForm -


this code load editscreen user model.

@login_required ()             def getuser (request, userid):      if request.method  == "get":         my_record = user.objects.get(user_id=userid)         form = userupdateform (instance=my_record)          print "registration page loading..."          return render(request, "en/updateuser.html", {'form': form } ) 

but 'user_id' (primarykey) not going part of 'form' when request update user i'm not able object instance update it. how set along form should able read it. thought of setting through hidden value felt not safe way.

please suggest.

why want send part of form? have in url (and therefore userid argument view), there's no need anywhere else.


Comments

Popular posts from this blog

Line ending issue with Mercurial or Visual Studio -

java - Jtable duplicate Rows -

java - Run a .jar on Heroku -