1👍
✅
You’ll need to create your own custom form field, which subclasses forms.ModelMultipleChoiceField and defines the to_python and prepare_value methods. Something like:
import ast
class StrModelMultipleChoiceField(forms.ModelMultipleChoiceField):
def to_python(self, value):
value = ast.literal_eval(value)
return super(StrModelMultipleChoiceField, self).to_python(value)
def prepare_value(self, value):
value = (super(StrModelMultipleChoiceField, self).prepare_value(value)
return unicode(value)
Source:stackexchange.com