Re: [sqlalchemy] [Q] How to return mapped instances from a recursive cte

2012-09-06 Thread Ladislav Lenart
It works! Thank you very much for such a quick response! It is a pity I was unable to find it on my own though. I spent several hours searching and reading various parts of SA documentation and on stackoverflow - I am a SQL / SA newbie and there is A LOT to read. But I've read select_from API

Re: [sqlalchemy] [Q] How to return mapped instances from a recursive cte

2012-09-06 Thread Michael Bayer
On Sep 6, 2012, at 5:07 AM, Ladislav Lenart wrote: It works! Thank you very much for such a quick response! It is a pity I was unable to find it on my own though. I spent several hours searching and reading various parts of SA documentation and on stackoverflow - I am a SQL / SA newbie

Re: [sqlalchemy] [Q] How to return mapped instances from a recursive cte

2012-09-06 Thread Ladislav Lenart
Hello. On 6.9.2012 13:04, Michael Bayer wrote: On Sep 6, 2012, at 5:07 AM, Ladislav Lenart wrote: It works! Thank you very much for such a quick response! It is a pity I was unable to find it on my own though. I spent several hours searching and reading various parts of SA documentation

Re: [sqlalchemy] [Q] How to return mapped instances from a recursive cte

2012-09-06 Thread Michael Bayer
On Sep 6, 2012, at 7:25 AM, Ladislav Lenart wrote: Hello. On 6.9.2012 13:04, Michael Bayer wrote: On Sep 6, 2012, at 5:07 AM, Ladislav Lenart wrote: It works! Thank you very much for such a quick response! It is a pity I was unable to find it on my own though. I spent several hours

Re: [sqlalchemy] [Q] How to return mapped instances from a recursive cte

2012-09-06 Thread Ladislav Lenart
Thank you for the explanation / brief history overview. Now it makes perfect sense why things are the way they are. Keep up the excellent work! Hopefully one day my knowledge of SQL Alchemy will catch up too :-) Ladislav Lenart On 6.9.2012 16:23, Michael Bayer wrote: On Sep 6, 2012, at 7:25

[sqlalchemy] [Q] How to return mapped instances from a recursive cte

2012-09-05 Thread Ladislav Lenart
Hello. I have the following example (Base is the usual declarative_base instance): class Node(Base): __tablename__ = 'node' id = Column(Integer(), primary_key=True) parent_id = Column(Integer(), ForeignKey('node.id')) def path(self, root_id): Query to return a list of

Re: [sqlalchemy] [Q] How to return mapped instances from a recursive cte

2012-09-05 Thread Michael Bayer
On Sep 5, 2012, at 9:05 AM, Ladislav Lenart wrote: Hello. I have the following example (Base is the usual declarative_base instance): class Node(Base): __tablename__ = 'node' id = Column(Integer(), primary_key=True) parent_id = Column(Integer(), ForeignKey('node.id'))