code: def resolve_sorting(self, query):
          
          sorting = {}
  
          # Sort on
          sort_on = query.get("sidx", None)
          sort_on = sort_on or query.get("sort_on", None)
          sort_on = sort_on == "Title" and "sortable_title" or sort_on
          if sort_on:
              sorting["sort_on"] = sort_on
  
              # Sort order
              sort_order = query.get("sord", None)
              sort_order = sort_order or query.get("sort_order", None)
              if sort_order in ["desc", "reverse", "rev", "descending"]:
                  sorting["sort_order"] = "descending"
              else:
                  sorting["sort_order"] = "ascending"
  
              # Sort limit
              sort_limit = api.to_int(query.get("limit", 30), default=30)
              if sort_limit:
                  sorting["sort_limit"] = sort_limit
  
          return sorting
docs: Resolves the sorting criteria for the given query