Ordering not used on ForeignKeyField form field RadioSelect widget
|Reported by:||Owned by:||nobody|
|Severity:||Normal||Keywords:||admin, ordering, foreignkey|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
I've spotted some inconsistency using the ordering option on Admin. By default, django.contrib.admin doesn't use the Admin ordering option when displaying a ForeignKeyField form field. However, when ordering is specified on model's Meta ordering option, the ordering appears.
Is that a bug or a feature ? Meaning : should the form field ordering follow the model's Meta definition, or should the admin's ordering option supersede the model's one ? (I thought about the later, thus this ticket.)
User(models.Model): class Meta: ordering = ('username', ) -> sort RadioSelect widget by username UserAdmin(admin.ModelAdmin): ordering = ('username', ) -> sort only list view by username