2017-11-01 2 views

답변

0

위젯은 모델이 아닌 ModelForm의 일부입니다. 다음과 같이 Meta 클래스 위젯 정의에 날짜 범위를 추가 할 수 있습니다.

class Meta: 
    model = YourModel 
    fields = '__all__' 
    widgets = { 
       'birthdate': SelectDateWidget(attrs = { 
       },years = range(1920, 2017),), 
      } 
관련 문제