以下の通り
forms.py
from django import forms
CHOICE = (
('', '選択肢から選んでください><'),
('0', 'キュート'),
('1', 'クール'),
('2', 'パッション'),
)
def SampleForm(forms.Form):
select = forms.ChoiceField(widget=forms.Select, choices=CHOICE)
はい
More than 5 years have passed since last update.
以下の通り
from django import forms
CHOICE = (
('', '選択肢から選んでください><'),
('0', 'キュート'),
('1', 'クール'),
('2', 'パッション'),
)
def SampleForm(forms.Form):
select = forms.ChoiceField(widget=forms.Select, choices=CHOICE)
はい
Register as a new user and use Qiita more conveniently