jazzband / jazzband/django-admin2

Distinguish empty_forms with inline formsets

Open
#342 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.2k
Forks
147
PR merge metrics
No merged PRs in 30d

Description

When looping through forms within an inline–formset, it currently looks like this:

```
{% for inline_form in formset %}
{% endfor %}
```

That does not allow to separate between forms and empty_forms (which is needed if you want to hide the empty_form without using hacks). We currently use something like {% if forloop.last %} ... add container and hide contents ... {% endfor %} which obviously is not a nice solution.

Therefor, I propose this:

```
{% for inline_form in formset.forms %}
{% endfor %}
{{ formset.empty_forms }}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.