[sqlalchemy] Re: unions and order_by

2009-01-26 Thread Michael Bayer
On Jan 25, 2009, at 8:41 PM, Brett wrote: 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

[sqlalchemy] Re: unions and order_by

2009-01-25 Thread Brett
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

[sqlalchemy] Re: unions and order_by

2009-01-24 Thread Michael Bayer
you shouldnt be using order_by on your mapper(). thats a really old option in any case.if you need it to be there, say query.order_by(None).statement to cancel the order_by in each separate part of the union. however it would be even easier if you just said query.union(q1, q2) here

[sqlalchemy] Re: unions and order_by

2009-01-24 Thread Michael Bayer
youre going to want to set order_by like this too instead of the string 'any' class Anything(Base): __tablename__ = 'anything' id = Column(Integer, primary_key=True) any = Column(String) something_id = Column(Integer, ForeignKey('something.id')) somethings =