Add docstrings for get_queryset overrides added in PR #18805 #10855

Closed
opened 2025-12-29 21:36:47 +01:00 by adam · 0 comments
Owner

Originally created by @bctiemann on GitHub (Mar 6, 2025).

Originally assigned to: @bctiemann on GitHub.

Proposed Changes

Add docstrings:

    def get_queryset(self, request):
        """
        Reapply model-level ordering in case it has been lost through .annotate().
        https://code.djangoproject.com/ticket/32811
        """
        qs = super().get_queryset(request)
        ordering = qs.model._meta.ordering
        return qs.order_by(*ordering)

Justification

Without inline documentation this code might seem unnecessary and the risk of removing it is invisible.

Originally created by @bctiemann on GitHub (Mar 6, 2025). Originally assigned to: @bctiemann on GitHub. ### Proposed Changes Add docstrings: ``` def get_queryset(self, request): """ Reapply model-level ordering in case it has been lost through .annotate(). https://code.djangoproject.com/ticket/32811 """ qs = super().get_queryset(request) ordering = qs.model._meta.ordering return qs.order_by(*ordering) ``` ### Justification Without inline documentation this code might seem unnecessary and the risk of removing it is invisible.
adam added the type: housekeeping label 2025-12-29 21:36:47 +01:00
adam closed this issue 2025-12-29 21:36:47 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#10855