Beispiel #1
0
class AssessmentForm(ModelForm):
    rating_choices = zip(range(1, 11), range(1, 11))

    total_rating = forms.ChoiceField(widget=forms.RadioSelect(),
                                     choices=rating_choices,
                                     help_text="")
    year_taken = forms.ChoiceField(
        widget=forms.Select(attrs={'class': 'chzn-select'}),
        choices=Assessment.get_year_choices())

    class Meta:
        model = Assessment
        fields = [
            'total_rating',
            'year_taken',
        ]