def sort_from_strings(model_cls, sort_parts):
 if (not sort_parts):
  sort = query.NullSort()
 elif (len(sort_parts) == 1):
  sort = construct_sort_part(model_cls, sort_parts[0])
 else:
  sort = query.MultipleSort()
  for part in sort_parts:
   sort.add_sort(construct_sort_part(model_cls, part))
 return sort

def sort_from_strings ( model_cls , sort_parts ) : if ( not sort_parts ) : sort = query . NullSort ( ) elif ( len ( sort_parts ) == 1 ) : sort = construct_sort_part ( model_cls , sort_parts [ 0 ] ) else : sort = query . MultipleSort ( ) for part in sort_parts : sort . add_sort ( construct_sort_part ( model_cls , part ) ) return sort
create a sort from a list of sort criteria .