Django - change select items display
问题 I use ModelForm . One of the fields is: repertoire = models.ForeignKey(Repertoire) I need to change its display type. Instead of using __str__ (or __unicode__ in Python 2) in display I want to show name and date of repertoire. How can I do this with ModelForm ? 回答1: Subclass ModelChoiceField and override label_from_instance to return the repertoire name and date. Then use the new field in your ModelForm . from django import forms class RepertoireModelChoiceField(forms.ModelChoiceField): def