I have a Dynamic Form in forms. How can I pass a argument from my view when I instantiate my form.
something like
form = DynamicForm("some string argument")
This is the form I have:
class DynamicForm(Form):
def __init__(self, *args, **kwargs):
super(DynamicForm, self).__init__(*args, **kwargs)
for item in range(5):
self.fields['test_field_%d' % item] = CharField(max_length=255)