def order_by(self, *props):
should_remove = len(props) == <NUM_LIT:1> and props[<NUM_LIT:0>] is None<EOL>if not hasattr(self, '<STR_LIT>') or should_remove:<EOL><INDENT>self._order_by = []<EOL>if should_remove:<EOL><INDENT>return self<EOL><DEDENT><DEDENT>if '<STR_LIT:?>' in props:<EOL><INDENT>self._order_by.append('<STR_LIT:?>')<EOL><DEDENT>else:<EOL><INDENT>for prop in props:<EOL><INDENT>prop = prop.strip()<EOL>if prop.startswith('<STR_LIT:->'):<EOL><INDENT>prop = prop[<NUM_LIT:1>:]<EOL>desc = True<EOL><DEDENT>else:<EOL><INDENT>desc = False<EOL><DEDENT>if prop not in self.source_class.defined_properties(rels=False):<EOL><INDENT>raise ValueError("<STR_LIT>".format(<EOL>prop, self.source_class.__name__))<EOL><DEDENT>property_obj = getattr(self.source_class, prop)<EOL>if isinstance(property_obj, AliasProperty):<EOL><INDENT>prop = property_obj.aliased_to()<EOL><DEDENT>self._order_by.append(prop + ('<STR_LIT>' if desc else '<STR_LIT>'))<EOL><DEDENT><DEDENT>return self<EOL>
Order by properties. Prepend with minus to do descending. Pass None to
remove ordering.