I often set options dynamically in the constructor:
class MyForm(BaseForm): afield = forms.ChoiceField(choices=INITIAL_CHOICES) def __init__(self, *args, **kwargs): super(MyForm, self).__init__(*args, **kwargs) self.fields['afield'].choices = my_computed_choices
maersu
source share