Hi, While reading the Django admin code I noticed this TODO in
BaseModelAdmin.get_queryset():
# TODO: this should be handled by some parameter to the ChangeList.
Currently ordering seems to be applied in two places:
- BaseModelAdmin.get_queryset() applies ordering directly to the queryset
- ChangeList.get_queryset() also retrieves ordering via
model_admin.get_ordering(request)
This appears to duplicate responsibility between ModelAdmin and ChangeList. Would the intended direction be to handle ordering entirely in ChangeList, for example by passing the ordering when constructing ChangeList inside ModelAdmin.get_changelist_instance(), instead of ChangeList calling model_admin.get_ordering() directly?
Thanks!