2👍
You haven’t told the model field to use the choices – so get_month_display won’t even be defined.
Also, I don’t understand why you have defined the field to be a char field of length 120: it should be an integer field, as that is what your values are.
month = models.IntegerField(choices=MONTH_CHOICES, null=False, blank=False)
0👍
You have set choices
in form field but trying get it from model field. And why don’t you use modelforms https://docs.djangoproject.com/en/dev/topics/forms/modelforms/
- [Answered ]-Form action isn't triggering at all
- [Answered ]-Adding Additional Hallo.js formatting features to Wagtail CMS RichTextField
- [Answered ]-How to generate a responsive PDF with Django?
Source:stackexchange.com