2017-12-01 1 views

답변

0

ChoiceField 대신 IntegerField을 사용해보세요.

+0

나는 이미 시도했지만 선택 옵션에는 몇 가지 문제가 있습니다. 어쨌든 고마워, 내가 해결할 :) –

0

마지막으로 Field type이 TypedChoiceField 인 것으로 확인되었습니다.이 경우 coerced = Int 인 경우 Integer가 반환됩니다.

units = forms.TypedChoiceField(choices=[(x, x) for x in range(1, 11)], coerce=int, help_text = 'Units: ') 
관련 문제