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)