> another option is:
> .query(Node).filter(not_(Node.id.in_(select([Node.parent_id]
jason, thanks for the alternative method. Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to
Steve Zatz wrote:
> I realize this is actually an SQL question but I haven't been able to
> figure out the answer.
>
> In a simple self-referential table, the following produces all the
> Nodes that are parents to some child node(s):
>
> node_table_alias = node_table.alias()
> parents = session.
Michael,
Works perfectly. Thanks much.
Steve
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send
On Jan 27, 2008, at 8:06 PM, Steve Zatz wrote:
>
> I realize this is actually an SQL question but I haven't been able to
> figure out the answer.
>
> In a simple self-referential table, the following produces all the
> Nodes that are parents to some child node(s):
>
> node_table_alias = node_tab
Works. Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For
whoops, lazy loaders needed awareness of that new parameter too, try
rev 2125.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To
Oops, I may have spoken too soon about things working...
The children relationship works fine and generates the correct query.
However, I don't think that the parent backref relationship is
generating the right query. item0.parent produces the following where
clause:
... WHERE ? = item.parent_
Works perfectly. Your responsiveness and the usefulness of SQLAlchemy
continue to amaze. Thanks.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@g
yeah... update to SVN 2124 and set up your mapper like this:
mapper(Item, item_table,
properties = dict(children = relation(Item,
remote_side=[item_table.c.parent_uuid], backref=backref('parent',
remote_side=[item_table.c.uuid])),
))
the "remote_side" argument will now be used to specify which