[sqlalchemy] Re: little trouble remote_side when local col points to same col in parent

2009-11-09 Thread David Gardner
Actually I hadn't realized that the problem only occurred on eagerloading. Would it make sense to be able to do an alias at the table level? In other words: task_parent=aliased(task_table) mapper(Task,task_table, properties={ 'Children' : relation(Task, backref=backref('Parent',

[sqlalchemy] Re: little trouble remote_side when local col points to same col in parent

2009-11-09 Thread Michael Bayer
On Nov 9, 2009, at 1:09 PM, David Gardner wrote: Actually I hadn't realized that the problem only occurred on eagerloading. Would it make sense to be able to do an alias at the table level? In other words: task_parent=aliased(task_table) mapper(Task,task_table, properties={

[sqlalchemy] Re: little trouble remote_side when local col points to same col in parent

2009-11-09 Thread David Gardner
Thanks for looking into this, just as an fyi this isn't effecting any production code for me, I still have the option of implementing parent/children using an integer id's column. Michael Bayer wrote: at that level. you'd at least want to use a table alias, i.e. task_table.alias() - but

[sqlalchemy] Re: little trouble remote_side when local col points to same col in parent

2009-11-08 Thread Michael Bayer
On Nov 6, 2009, at 7:53 PM, David Gardner wrote: CREATE TABLE task ( name text NOT NULL, asset text NOT NULL, parent_asset text, more columns CONSTRAINT task_PK PRIMARY KEY (asset, name), CONSTRAINT task_parent_FK FOREIGN KEY (parent_asset, name) REFERENCES task (asset, name)