From 6195cd73905659b305a6ec18ad76d09dbbc53552 Mon Sep 17 00:00:00 2001 From: Alexei Date: Wed, 6 Nov 2013 13:55:40 +0300 Subject: [PATCH] Make fast query with "count(*)" instead selecting all data --- adminsortable/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adminsortable/utils.py b/adminsortable/utils.py index 5cc41b1..b38c42a 100644 --- a/adminsortable/utils.py +++ b/adminsortable/utils.py @@ -1,4 +1,4 @@ def get_is_sortable(objects): - if len(objects) > 1: + if objects.count() > 1: return True return False