2👍
✅
The magic of django forms is that you don’t need to do all that. By calling the form’s select field by name, it will render it and select the right option as based on initial/instance data passed into the form on instantation.
{{form.working_month}}
If you’re still having troubles, can you post the form class as well?
Good luck!
EDIT
In looking at the first comment on the link you posted, this issue is addressed. The commenter included this code
def __init__(self, *args, **kwargs):
forms.MultiValueField.__init__(self, *args, **kwargs)
self.fields = (forms.CharField(), forms.CharField(),)
0👍
A slight variation of your problem is solved here
- [Answered ]-Django Admin Inline objects
- [Answered ]-Whats wrong with an assignment
- [Answered ]-Delecting empty ModelChoiceField in template
- [Answered ]-Django runfcgi mode timeout
Source:stackexchange.com