def sort_by(self, expr, sort_exprs):
    sort_exprs = util.promote_list(sort_exprs)
    if (not self.blocks()):
        resolved_keys = _maybe_convert_sort_keys(self.table, sort_exprs)
        if (resolved_keys and self.table._is_valid(resolved_keys)):
            return Selection(self.table, self.selections, predicates=self.predicates, sort_keys=(self.sort_keys + resolved_keys))
    return Selection(expr, [], sort_keys=sort_exprs)
def sort_by(self, expr, sort_exprs):
    sort_exprs = util.promote_list(sort_exprs)
    if (not self.blocks()):
        resolved_keys = _maybe_convert_sort_keys(self.table, sort_exprs)
        if (resolved_keys and self.table._is_valid(resolved_keys)):
            return Selection(self.table, self.selections, predicates=self.predicates, sort_keys=(self.sort_keys + resolved_keys))
    return Selection(expr, [], sort_keys=sort_exprs)