mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-13 16:47:34 -06:00
Add docstrings for get_queryset base class methods
This commit is contained in:
parent
3ef7ab4416
commit
eeadf7b9e4
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user