https://docs.djangoproject.com/en/dev/ref/forms/api/#prefixes-for-forms
Regards, Alasdair On 15/06/11 14:09, Thomas Weholt wrote:
I got several forms I need to display in one page and post to one site. Actually, what I want to do is take all the fields from all the forms and display them as one form and post all input to one view. To avoid collision between the form fields I want to prefix the fields somehow. Say I got three forms: class UserInputForm1(forms.Form): username = forms.CharField() password = forms.CharField() class UserInputForm2(forms.Form): comment = forms.CharField() class UserInputForm3(forms.Form): like = forms.BooleanField() I want to put all fields, from all three forms, into one new form and prefix each field so I know what form the field came from. How can I do that? When I access the fields after creation it appears to be a string. An alternative to this is a FormWizard, but that makes the user click thru a bunch of steps, which could be avoided if I could get all the fields into one new form.
-- Alasdair Nicol Developer, MEMSET mail: alasd...@memset.com web: http://www.memset.com/ Memset Ltd., registration number 4504980. 25 Frederick Sanger Road, Guildford, Surrey, GU2 7YD, UK. -- 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+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.