OK, here is the question.
class UserForm(forms.ModelForm):
class Meta:
model = User
fields = ('team', 'related_projects')
In models.py
the User
class is defined as follows:
class User (models.Model):
team = models.ForeignKey(Team, verbose_name = _('team'))
related_projects = models.ManyToManyField(Project, blank = True)
Both team
and related_projects
are rendered as a dropdown-box. The values are all the existing teams in the system, and all the existing projects in the system. That's all right, but they're only ordered by primary key, and I would like to see them ordered alphabetically. Where should I specify ordering for values in a drop-down list?