Quick shortcut for including hidden fields in your forms:
forms.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SomeForm(forms.Form): | |
hidden = forms.CharField(required=False, max_length=50, widget=forms.HiddenInput()) |
template.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for hidden in form.hidden_fields %} | |
{{ hidden }} | |
{% endfor %} |
Now you don’t have to worry about each and every hidden field.
Nice catch!