mirror of
https://github.com/jazzband/django-admin-sortable.git
synced 2026-03-23 17:30:25 +00:00
Refactored sorting filters from class method into a model property with a default of an empty dictionary. Refactored sortable admin class to not make two calls to determine sortability and also to get objects for sorting. Added sorting_filters to sortable admin queryset.
5 lines
119 B
Python
5 lines
119 B
Python
def get_is_sortable(objects):
|
|
if objects:
|
|
if objects.count() > 1:
|
|
return True
|
|
return False
|