I have a form like this:
RANGE_CHOICES = (
('last', 'Last Year'),
('this', 'This Year'),
('next', 'Next Year'),
)
class MonthlyTotalsForm(forms.Form):
range = forms.ChoiceField(choices=RANGE_CHOICES, initial='this')
It is displayed in the template as follows:
{{ form.range }}
In some situations, I don’t want to show the Next Year option. Is it possible to remove this option in the view where the form is created?
gerty source
share