I generate a form dynamically:
form = forms.Form()
form.fields['myname'] = forms.CharField(label=u'My Name')
...
and then show 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 a bound instance, by changing the first line to
form = forms.Form(request.POST)
before I begin to generate the dynamic form.
However, is there a way to keep the dynamic form generation code as is, and then late bind the form to request.POST data?
Thanks