Re: [sqlalchemy] selecting from a union

2014-09-26 Thread Michael Bayer
On Sep 26, 2014, at 7:15 PM, Jonathan Vanasco wrote: > So I've been making the list of what common functions returns what classes > (and what operations can be placed on them; i figured it would be good for > the faq) , and noted a few slight inconsistencies. > > A few examples > > * The API

Re: [sqlalchemy] selecting from a union

2014-09-26 Thread Jonathan Vanasco
So I've been making the list of what common functions returns what classes (and what operations can be placed on them; i figured it would be good for the faq) , and noted a few slight inconsistencies. A few examples * The API docs for orm.query.Query.subquery() state that the response is wrapp

Re: [sqlalchemy] selecting from a union

2014-09-26 Thread Jonathan Vanasco
Thanks, this helps. A lot. Makes me think there could/should be an FAQ item on what can be selected from what type of objects and how. That'll go on my todo. I could do this as a subquery. i actually might, as it appears to be running 10% faster as a subquery. The reason why it's CTE that I

[sqlalchemy] Joined table inheritance - get inherited class object

2014-09-26 Thread Alexey Vihorev
Hi! I got this class arrangement: class Document(Base): doc_number = Column(:) doc_date = Column(:) : class Invoice(Document) class CashOrder(Document) class BankTransaction(Document) It's joined table inheritance, Document has a table with discriminator etc. So,