1👍
✅
It can be any type of field like Char
or Int
but you can provide list of choices to it which will show as dropdown in the html form.
Reference at Model field Choices
YEAR_IN_SCHOOL_CHOICES = (
('FR', 'Freshman'),
('SO', 'Soph*m*re'),
('JR', 'Junior'),
('SR', 'Senior'),
)
class Student(models.Model):
year_in_school = models.CharField(max_length=2,
choices=YEAR_IN_SCHOOL_CHOICES, default='FR')
Source:stackexchange.com