django checkbox form for ModelMultipleChoiceField label for each input django checkbox form for ModelMultipleChoiceField label for each input django django

django checkbox form for ModelMultipleChoiceField label for each input


I think you want to override in your form label_from_instance

The unicode method of the model will be called to generate string representations of the objects for use in the field's choices; to provide customized representations, subclass ModelChoiceField and override label_from_instance. This method will receive a model object, and should return a string suitable for representing it. For example:

def label_from_instance(self, obj):    #custom logic here...    return smart_unicode(obj)