4👍
✅
You can use Django dynamic Form generation
from django import forms
class MyForm(forms.Form):
def __init__(self, *args, **kwargs):
super(MyForm, self).__init__(*args, **kwargs)
for i in range(20):
self.fields["file_%d" % i] = forms.FileInput()
See Docs here.
- [Django]-Syntax for Disabling all form fields in Django
- [Django]-RelatedObjectDoesNotExist at /admin/login/ User has no scuser
- [Django]-Django admin model add_view: how to remove "save and add another" buttons?
Source:stackexchange.com