MCPcopy
hub / github.com/django/django / get_sortable_by

Method get_sortable_by

django/contrib/admin/options.py:488–494  ·  view source on GitHub ↗

Hook for specifying which fields can be sorted in the changelist.

(self, request)

Source from the content-addressed store, hash-verified

486 return qs
487
488 def get_sortable_by(self, request):
489 """Hook for specifying which fields can be sorted in the changelist."""
490 return (
491 self.sortable_by
492 if self.sortable_by is not None
493 else self.get_list_display(request)
494 )
495
496 def lookup_allowed(self, lookup, value, request):
497 from django.contrib.admin.filters import SimpleListFilter

Callers 1

Calls 1

get_list_displayMethod · 0.45

Tested by

no test coverage detected