Add docstrings for get_queryset base class methods (#18832)
This commit is contained in:
@@ -122,6 +122,10 @@ class NetBoxModelViewSet(
|
||||
return obj
|
||||
|
||||
def get_queryset(self):
|
||||
"""
|
||||
Reapply model-level ordering in case it has been lost through .annotate().
|
||||
https://code.djangoproject.com/ticket/32811
|
||||
"""
|
||||
qs = super().get_queryset()
|
||||
ordering = qs.model._meta.ordering
|
||||
return qs.order_by(*ordering)
|
||||
|
@@ -126,6 +126,10 @@ class ObjectListView(BaseMultiObjectView, ActionsMixin, TableMixin):
|
||||
#
|
||||
|
||||
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)
|
||||
|
Reference in New Issue
Block a user