Re: [SQLObject] Self LEFT JOIN.

2010-12-23 Thread Oleg Broytman
On Wed, Dec 22, 2010 at 10:44:49PM -0500, Ben Timby wrote: > Oleg, I tried this out, my code is: > > -- > joins = [] > alias1 = Path > path_parts = path.split(os.sep) > for depth, part in enumerate(path_parts): > alias2 = sqlbuilder.Alias(Path) > joins.append(sqlbuilder.LEFTJOINOn(alias1,

Re: [SQLObject] Self LEFT JOIN.

2010-12-21 Thread Oleg Broytman
Hi! On Mon, Dec 20, 2010 at 09:46:16PM -0500, Ben Timby wrote: > class Path(sqlobject.SQLObject): > parent = sqlobject.ForeignKey('SyncPath', cascade=True) As far as I understand from the following query, 'SyncPath' should be just 'path', right? > path = sqlobject.StringCol(alternateI

[SQLObject] Self LEFT JOIN.

2010-12-20 Thread Ben Timby
I am using an adjacency list to store file system paths. -- class Path(sqlobject.SQLObject): parent = sqlobject.ForeignKey('SyncPath', cascade=True) path = sqlobject.StringCol(alternateID=True) -- I would like to retrieve an object given it's path in one fell swoop. Below is an example...