forms.py
class AddDuration(forms.Form):
def __init__(self, *args, **kwargs):
super(AddDuration, self).__init__(*args, **kwargs)
// set value to relates_to_choices
relates_to_choices = ????????????? // Something like self.choices
self.fields['duration'].choices = relates_to_choices
duration = forms.ChoiceField(required=True)
Now, I have a views.py file that has a class
class AddDurationView(FormView):
template_name = 'physician/add_duration.html'
form_class = AddDurationForm