Re: [sqlalchemy] Re: using set returning function in a relationship

2010-08-11 Thread Michael Bayer
On Aug 11, 2010, at 1:55 PM, Michael Bayer wrote: > > What is implied by relationship() is that you're joining and limiting a full > set of records using a join condition. This implies that the mapped > selectable would be returning a set of rows corresponding to all possible > child collect

Re: [sqlalchemy] Re: using set returning function in a relationship

2010-08-11 Thread Michael Bayer
On Aug 11, 2010, at 1:19 PM, botz wrote: > Thanks for that... I didn't manage to get it to work straight off, but > it seems like I'm close. > > Tried a couple things just to force it to behave as I wanted. > > > # defined the selectable > selectable = select( [ sql.column( 'x' ), sql.column('

[sqlalchemy] Re: using set returning function in a relationship

2010-08-11 Thread botz
And really if I could just plug in the argument for the foo_props call, at least in this case it would remove the need for the foreign key altogether as the join is really handled by the semantics of the foo_props call, which happens to only return the one related row. I suppose this could all be

[sqlalchemy] Re: using set returning function in a relationship

2010-08-11 Thread botz
Thanks for that... I didn't manage to get it to work straight off, but it seems like I'm close. Tried a couple things just to force it to behave as I wanted. # defined the selectable selectable = select( [ sql.column( 'x' ), sql.column('y')], from_obj = [ func.foo_

Re: [sqlalchemy] Re: using set returning function in a relationship

2010-08-11 Thread Michael Bayer
On Aug 10, 2010, at 11:20 PM, botz wrote: > oops, didn't mean to submit that quite yet. crazy dog... > > anyways, given that I have foo_props() which acts as a kind of from- > clause > as in > select * from foo_props( 123); > > I'd like to use that in relationship to a Foo class > > i.e. > m

[sqlalchemy] Re: using set returning function in a relationship

2010-08-10 Thread botz
oops, didn't mean to submit that quite yet. crazy dog... anyways, given that I have foo_props() which acts as a kind of from- clause as in select * from foo_props( 123); I'd like to use that in relationship to a Foo class i.e. mapper( Foo, foo_table, properties( props = relationship( FooProps