[Answer]-How to use initialize FormModel with request.post and model instance.

1👍

The code you are writing is already in the framework.

urls.py

from django.views.generic import UpdateView
from myapp.forms import InfoForm
urlpatterns = patterns('',
    url(r'^info/(?P<pk>[-_\w]+)/update/$', UpdateView.as_view(model= Info,template_name="hello/home.html",form_class=InfoForm), name='info_update'), 
)
# you might need to include a success url in the **kwargs i.e. success_url="/thankyou/"

Leave a comment