#34566: ModelAdmin get_field_queryset uses related admin ordering, but not
related
admin querysets.
-------------------------------+------------------------------------
Reporter: Mike J | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1
Needs tests: 1 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Comment (by fisadev):
Hi! I'm, Juan, the one who added that get_field_queryset override making
use of get_ordering (
https://github.com/django/django/commit/d9330d5be2ee60b208dcab2616eb164ea2e6bf36
).
I'm not entirely sure what was the reasoning behind the decision to use
get_ordering instead of get_queryset, which AFAIK was already present at
that time. Maybe we didn't realize because we were focused on solving the
ordering problem, so calling get_ordering was the most obvious solution
and we didn't notice we could be using get_queryset? Or maybe it was
because of performance reasons or sounded overkill to use get_queryset, as
maybe get_queryset tends to get more data than needed just to populate the
drop down in the related model admin? But that might be a little too
opinionated.
I'm not sure what would be the best today. Sorry!
--
Ticket URL: <https://code.djangoproject.com/ticket/34566#comment:8>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018c02527dcb-dc77fdc6-b44d-40be-b747-08a7ff1575b7-000000%40eu-central-1.amazonses.com.