Merge pull request #112 from Thermondo/master
fix slow get_is_sortable when using with inline admins
This commit is contained in:
@@ -6,11 +6,13 @@ def check_inheritance(obj):
|
|||||||
|
|
||||||
|
|
||||||
def get_is_sortable(objects):
|
def get_is_sortable(objects):
|
||||||
if objects:
|
if objects.count() < 2:
|
||||||
if check_inheritance(objects[0]):
|
return False
|
||||||
if objects.count() > 1:
|
|
||||||
return True
|
if not check_inheritance(objects[:1][0]):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
return True
|
||||||
|
|
||||||
|
|
||||||
def is_self_referential(cls):
|
def is_self_referential(cls):
|
||||||
|
|||||||
Reference in New Issue
Block a user