code: def order_by_on_list(objects, order_field, is_desc=False):
      
      if callable(order_field):
          objects.sort(key=order_field, reverse=is_desc)
          return
  
      def order_key(x):
          v = getattr_path(x, order_field)
          if v is None:
              return MIN
          return v
  
      objects.sort(key=order_key, reverse=is_desc)
docs: Utility function to sort objects django-style even for non-query set collections
  
      :param objects: list of objects to sort
      :param order_field: field name, follows django conventions, so "foo__bar" means `foo.bar`, can be a callable.
      :param is_desc: reverse the sorting
      :return: