I try to log value of ModelMultipleChoiceField
logger.debug("names %s" % self.fields['names_list'])
But I got
2016-08-09 17:00:19,027 DEBUG views names <django.forms.models.ModelMultipleChoiceField object at 0xa74d0bcc>
The expected result is sth like:
2016-08-09 17:00:19,027 DEBUG views names [33,40,45]
update I'm not sure what is unclear - I suppose, that you want to see the model, but i think is useless - i don't need any value just pk of instances which are selected in ModelMultipleChoiceField
I need to debug because when I enter form i set some hidden fields:
<input id="id_names" name="names" type="hidden" value="[33]" />
and I'm trying to set it using additional field (using ModelMultipleChoiceField) - during clean I'm veryfing checkings and set values. But it looks like ModelMultipleChoiceField is empty in clean, so I want to debug if it's true.
(I have to rename field names into names_list because you may think that hidden field and multiplechoicefield have the same names)