class testform(forms.Form):
Q = forms.CharField()
You could then create a formset like so:
from django.forms.formsets import formset_factoryOnce displayed in the template, this would show two instances of the form giving you the two fields you require. You could then either change the extra attribute in the view if you know how many fields you require, or you could use the django-dynamic-formset jQuery plugin in order to allow the user to add or remove more forms dynamically.
formset = formset_factory(testform, extra=2)
Hope this helps,
Ryan
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
No comments:
Post a Comment