Saturday, January 28, 2017

Re: Separator between forms in formset factory

On Sat, Jan 28, 2017 at 04:33:47AM -0800, Jeroen van Oorschot wrote:
> Hi,
> I'm using a
> modelformset_factory()
>
> for displaying a form multiple times automatically. This works perfect.
>
> I would like to have some kind of separator between the individual forms in
> the page. Now the formsetfactory just shows all forms after eachother, and
> it can be quite hard too see which input belongs to which form.
>
> Does anyone have an idea how to make this? If not, i'd like to request it
> as a feature on the formset_factory
> <https://docs.djangoproject.com/en/1.10/_modules/django/forms/formsets/#formset_factory>
> .
>
> Kind regards,
> Jeroen

Hi Jeroen,

Have you considered simply iterating over the individual forms in your
template, and including the separator in the for loop? You can find
some examples in the docs [1].

Good luck,

Michal


[1]: https://docs.djangoproject.com/en/1.10/topics/forms/formsets/#using-a-formset-in-views-and-templates

--
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20170128163659.GA23772%40koniiiik.org.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment