models.py:
class Foo(models.Model): ... TIME_UNIT_TYPE = ( (\'D\', \'Day\'), (\'W\', \'Week\'), (\'M\', \'Month\'), )
Try with:
from django.forms import ModelForm from django import forms as forms class FooForm(ModelForm): time_unit = forms.forms.TypedChoiceField( required=True, choices = Foo.TIME_UNIT_TYPE ) class Meta: model = Foo fields = (time_unit,)
Test if this works for you.