Saturday, January 28, 2017

Re: Separator between forms in formset factory

How you render your formset.
You can add separator in your html template:

example:
{% for form in formset.forms %}
   
{{ form.as_p }}
   
{% if not forloop.last %}
       
<hr/>
   
{% endif %}
{% endfor %}




W dniu sobota, 28 stycznia 2017 15:08:00 UTC+1 użytkownik Jeroen van Oorschot napisał:
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.

Kind regards,
Jeroen

--
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/ca03d2d0-ecb3-45bc-bdb6-a54822aa8196%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment