I generate the form dynamically:
form = forms.Form() form.fields['myname'] = forms.CharField(label=u'My Name') ...
and then display the form with:
buf = '....<form action="." method="POST">...' + form.as_p() + '...' t = Template(buf) v = RequestContext(request, {'form': form}) html = t.render(v) ...
I could get the linked instance by changing the first line to
form = forms.Form(request.POST)
before I start generating a dynamic form.
However, is there a way to keep the dynamic form generation code as is and then be late to link the form for the request. POST data?
thanks
source share