The "Controlling Ordering" section of the docs mentions that using order_by on mappers is the standard way for setting a default ordering against a single mapped entity. This seems like a good feature. Is there another way? Will this be deprecated in the future?
What's also really weird is that if I put my __mapper_args__ at the beginning of the definition of Anything then I get the following errors for q1.union(q2), query.union(q1, q2) and query.union_all(q1, q2): File "/usr/lib/python2.5/site-packages/SQLAlchemy-0.5.2-py2.5.egg/ sqlalchemy/sql/visitors.py", line 247, in clone cloned[element] = element._clone() AttributeError: 'str' object has no attribute '_clone' If I put __mapper_args__ at the end it passes through. Also if I use the original: u = union(q1.statement, q2.statement) print list(session.query(Anything).from_statement(u)) ... then it doesn't matter where the __mapper_args__ are. And for posterity, this is where the order_by(None)'s should be: q1 = session.query(Anything).join('somethings').order_by(None) q2 = session.query(Anything).join('somethings').order_by(None) q = session.query(Anything).order_by(None).union(q1, q2) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---