I've been struggling with Django choice fields in form. I have choices in my forms.py and a radio choice field.
DURATION_CHOICES = {
(1, '30'),
(2, '45'),
(3, '60'),
(4, '75'),
(5, '90'),
(6, '105'),
(7, '120+'),
}
duration = forms.ChoiceField(choices=DURATION_CHOICES, widget=forms.widgets.RadioSelect, label_suffix="", label="Trainingsdauer in Minuten",)
However when I open the form to create a new training session, the duration radio select field is randomly ordered, i.e. 105 is in the list before 45. The order even changes from testing devices to another
I have the very same problem with choice fields from models.py
I have already ordered my choices but how do I get the ordered choice list in my form?