def METHOD_NAME(self, request):
    param = request.query_params.get(
        self.ordering_param, self.default_ordering)
    order = 'asc'
    if param.startswith('-'):
        order = 'desc'
        param = param[1:]
    if param not in self.allowed_ordering:
        raise exceptions.ValidationError(
            f'{repr(param)} is not a valid ordering parameter value.')
    return param, order