@@ -545,8 +545,8 @@ def migratable(self, export_path='', missing_storage=False):
545
545
def non_migratable (self ):
546
546
return self .exclude (pk__in = self .migratable ())
547
547
548
- def natural_sort (self ):
549
- return natural_sort (self , 'medium_id' )
548
+ def natural_sort (self , column = 'medium_id' ):
549
+ return natural_sort (self , column )
550
550
551
551
def fastest (self ):
552
552
container = Case (
@@ -734,8 +734,8 @@ def readable(self):
734
734
storage_medium__status__in = [20 , 30 ]
735
735
)
736
736
737
- def natural_sort (self ):
738
- return natural_sort (self , 'content_location_value' )
737
+ def natural_sort (self , column = 'content_location_value' ):
738
+ return natural_sort (self , column )
739
739
740
740
def fastest (self ):
741
741
container = Case (
@@ -763,7 +763,8 @@ def fastest(self):
763
763
remote = remote ,
764
764
storage_type = storage_type ,
765
765
content_location_value_int = content_location_value_int ,
766
- ).order_by ('remote' , 'container_order' , 'storage_type' , 'storage_medium' , 'content_location_value_int' )
766
+ ).order_by ('remote' , 'container_order' , 'storage_type' ).natural_sort ('storage_medium__medium_id'
767
+ ).order_by ('content_location_value_int' )
767
768
768
769
769
770
class StorageObject (models .Model ):
@@ -1092,8 +1093,8 @@ def __str__(self):
1092
1093
1093
1094
1094
1095
class TapeSlotQueryset (models .QuerySet ):
1095
- def natural_sort (self ):
1096
- return natural_sort (self , 'medium_id' )
1096
+ def natural_sort (self , column = 'medium_id' ):
1097
+ return natural_sort (self , column )
1097
1098
1098
1099
1099
1100
class TapeSlot (models .Model ):
0 commit comments