@fluent<EOL><INDENT>def order_by(self, attribute=None, *, ascending=True):<DEDENT>
attribute = self._get_mapping(attribute) or self._attribute<EOL>if attribute:<EOL><INDENT>self._order_by[attribute] = None if ascending else '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>return self<EOL>
Applies a order_by clause

        :param str attribute: attribute to apply on
        :param bool ascending: should it apply ascending order or descending
        :rtype: Query