[sqlalchemy] Re: Self Join via Join Table ?

2009-02-25 Thread Stephen Telford
Hello Az, Yes, Bar is the association table of Foo to Foo. In essence, this is a self join through a join table.. I have tried and hit my head on this for (quite literally) hours. In the end, and for the record, I ended up creating a method on the model itself such as ; def

[sqlalchemy] Re: Self Join via Join Table ?

2009-02-25 Thread Stephen Telford
. it will ultimately use Foo/Bar for querying but attribute access would be proxied through the names you confgure. On Feb 25, 2009, at 4:11 PM, Stephen Telford wrote: Hello Az, Yes, Bar is the association table of Foo to Foo. In essence, this is a self join through a join table.. I have tried

[sqlalchemy] Re: Self Join via Join Table ?

2009-02-25 Thread Stephen Telford
'), nullable=False), Column('child_id', Integer, ForeignKey('foo.id'), nullable=False)) Foo.children = relation(Foo, secondary = bar_table, primaryjoin = bar_table.c.parent_id == Foo.id, secondaryjoin=bar_table.c.child_id == Foo.id, backref='parents') On Wed, Feb 25, 2009 at 3:12 PM, Stephen Telford

[sqlalchemy] Re: Self Join via Join Table ?

2009-02-25 Thread Stephen Telford
and of course, both the passwords -are- the same (duh ;) .. the 'get()' works fine (obviously ;) Regards Stef On Wed, Feb 25, 2009 at 7:53 PM, Stephen Telford stelford1...@gmail.comwrote: Thank you Bobby!! That does make things more easier, and it shows then that I am being a -real- moron