I have this working code
f = SomeForm(request.POST)
When I tried to modify it into
f = SomeForm(request.POST, initial={'spam', 4})
it didnt work, the 'initial' wasnt selected ('spam' is a ModelChoiceField), but when I tried
f = SomeForm(initial={'spam', 4})
it worked (selected value was correct). Am I missing something here? If it matters, heres what its init method looks like
def __init__(self, *a, **ka):
super(SomeForm, self).__init__(*a, **ka)
....#more codes
Is there a way to make the initial data works without having to remove the first argument? Thank you
EDIT : it doesnt have to be "initial", as long as I can put some pre-determined value on ModelChoiceField. The condition = There is a request.POST, but the form hasnt been submitted (the post came from another page)