I have the following in one of my forms:
self.fields['advisor'].queryset = User.objects.filter(groups__name='advisor')
The only problem is that it displays the username in the drop down box. What I would like to do is display the first_name then last_name to make it more human readable.
Any ideas?
The
ModelChoiceFieldhas alabel_from_instancemethod which can be changed in a subclass to use something other than the model__unicode__method. https://docs.djangoproject.com/en/1.3/ref/forms/fields/#django.forms.ModelChoiceField.empty_label