You just need to set your argument to super() and put it in the fields dictionnary after super() :
class EpisodeCreateForm(forms.Form): my_field = forms.CharField(label='My field:') def __init__(self, *args, **kwargs): my_arg = kwargs.pop('my_arg') super(EpisodeCreateForm, self).__init__(*args, **kwargs) self.fields['my_arg'].initial = my_arg
Then just call
form = EpisodeCreateForm (my_arg=foo)
As an example, let's say that you have a table of episodes, and you want to show available in the selection menu and select the current episode. To do this, use ModelChoiceField :
class EpisodeCreateForm(forms.Form): available_episode_list = Episode.objects.filter(available=True) my_field = forms.ModelChoiceField(label='My field:', queryset=available_episode_list) def __init__(self, *args, **kwargs): cur_ep = kwargs.pop('current_episode') super(EpisodeCreateForm, self).__init__(*args, **kwargs) self.fields['current_episode'].initial = cur_ep
source share