i am trying to use FilteredSelectMultiple widget to display list of users. currently it is displaying only username. I have tried to override the label_from_instance as seen below but it does not seem to work. how can it get to display users full name.
class UserMultipleChoiceField(FilteredSelectMultiple):
"""
Custom multiple select Feild with full name
"""
def label_from_instance(self, obj):
return "%s" % (obj.get_full_name())
class TicketForm(forms.Form):
cc_to = forms.ModelMultipleChoiceField(queryset=User.objects.filter(is_active=True).order_by('username'), widget=UserMultipleChoiceField("CC TO", is_stacked=True)