def order_by(self, *field_names):
obj = self._clone()<EOL>obj._clear_ordering()<EOL>for field in field_names:<EOL><INDENT>if field.startswith("<STR_LIT:->"):<EOL><INDENT>obj._ordering.append({ field.lstrip("<STR_LIT:->").replace("<STR_LIT>", "<STR_LIT:.>") : "<STR_LIT>" })<EOL><DEDENT>else:<EOL><INDENT>obj._ordering.append({ field : "<STR_LIT>" })<EOL><DEDENT><DEDENT>return obj<EOL>
Returns a new QuerySet instance with the ordering changed.