So in my Django project, I am using a formwizard for a multi-page form. On
one of those pages, I want a form as well as a formset (sadly, this is
absolutely necessary). The formwizard can do these things separately but
not together, so I found this ticket
<https://code.djangoproject.com/ticket/18830> () on the django development
side, which brought me to the use of a form_container like this one
<https://code.djangoproject.com/attachment/ticket/18830/form_container.py>.
Now for using this container, i have in my forms.py:
"
*AddressesFormSet = formset_factory(EmailAddressForm)*
*class UserFormsContainer(FormContainer):*
* user = UserDetailForm*
* addresses = AddressesFormSet*
"
In my urls.py:
* url(r'^$', views.ContactWizard.as_view([("0", UserFormsContainer),]),
name='index'),*
Only, when I call this container in the formwizard (which should work), the
html output is this:
*''<form action="" method="post"><input type="hidden"
name="csrfmiddlewaretoken" value="8Xnov8eCwnenDgBiUbstzPXsUDsFeBom">''*
* ''user''*
* ''addresses''*
*''<table>''*
* ''<input id="id_full_form_view-current_step"
name="full_form_view-current_step" type="hidden" value="0"></table>''*
*''<input type="submit" value="next">''*
*''</form>''*
Instead of the actual forms I expected...
I think the problem might be in the following part of the form container,
because it describes the behaviour of the form as I see it (it shows me the
labels for the forms in the container).
* def get_form_kwargs(self, prefix, **kwargs):*
* """Return per-form kwargs for instantiating a specific form*
* By default, just returns the kwargs provided. prefix is the*
* label for the form in the container, allowing you to specify*
* extra (or less) kwargs for each form in the container.*
* """*
* return kwargs*
However, I want it to actually show the forms, but since I am not very
familliar with the django source-code I don't know how to edit my
formcontainer to do this.
Can anyone help me with this issue? Thanks in advance!
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-users/238025d5-c4a3-4574-9897-8439ec4ebb2f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.