[sqlalchemy] Re: class-object-like attribute lookup

2007-01-25 Thread Christopher Arndt
Karl Guertin schrieb: Looks like you want recursive single table inheritance [1]. It doesn't need to be recursive, just a two-level parent-child relation. And I don't want to add any columns, so I was thinking that table inheritance is not the right approach, but I'm not sure about that. Chris

[sqlalchemy] Re: class-object-like attribute lookup

2007-01-25 Thread Karl Guertin
On 1/25/07, Christopher Arndt [EMAIL PROTECTED] wrote: It doesn't need to be recursive, just a two-level parent-child relation. And I don't want to add any columns, so I was thinking that table inheritance is not the right approach, but I'm not sure about that. I was thinking that you could

[sqlalchemy] Re: class-object-like attribute lookup

2007-01-25 Thread Rick Morrison
You could do this in a single join using COALESCE on the fallback columns. Rick On 1/25/07, Karl Guertin [EMAIL PROTECTED] wrote: On 1/25/07, Christopher Arndt [EMAIL PROTECTED] wrote: It doesn't need to be recursive, just a two-level parent-child relation. And I don't want to add any

[sqlalchemy] Re: class-object-like attribute lookup

2007-01-25 Thread Michael Bayer
COALESCEwow i need to read some SQL books again... :) On Jan 25, 2007, at 11:17 AM, Rick Morrison wrote: You could do this in a single join using COALESCE on the fallback columns. Rick On 1/25/07, Karl Guertin [EMAIL PROTECTED] wrote: On 1/25/07, Christopher Arndt [EMAIL

[sqlalchemy] Re: class-object-like attribute lookup

2007-01-25 Thread Rick Morrison
Dude, you should be WRITING them! On 1/25/07, Michael Bayer [EMAIL PROTECTED] wrote: COALESCEwow i need to read some SQL books again... :) On Jan 25, 2007, at 11:17 AM, Rick Morrison wrote: You could do this in a single join using COALESCE on the fallback columns. Rick On

[sqlalchemy] Re: class-object-like attribute lookup

2007-01-25 Thread Michael Bayer
On Jan 25, 2007, at 9:35 AM, Christopher Arndt wrote: As you can see 'parent_id' is a self-referencing FK to the bookmarks table. The idea now is to allow users to have their own copies of mapped 'Bookmark' objects, that are a sort of child of an existing 'Bookmark' object and allow