1

I'm trying to get a list of weekday options into a PositiveSmallIntegerField in Django and back to the form.

I found a very similar question from the year 2011 which covers the process of having a MultiSelect widget with weekday options, Representing a multi-select field for weekdays in a Django model. Also, there has been an additional question regarding the reverse process, Custo widget based on CheckBoxMultipleSelect for weekdays in Django by user gabn88, which sadly has been deleted since.

I tried the approach with the BitChoices class in the first post, and the class itself seems to work. However, I fail to put the selection back to something I can fill the form with. At least that's what I think judging from the error message on my view:

Select a valid choice. ['2', '16', '128'] is not one of the available choices.

Can anybody help me out, please?

Martin K
  • 33
  • 4

0 Answers0