3 messages in com.googlegroups.sqlalchemy[sqlalchemy] odd adjancency list w/ j...
FromSent OnAttachments
Kapil Thangavelu29 Nov 2007 09:25.txt, .py
Michael Bayer29 Nov 2007 10:49 
Michael Bayer29 Nov 2007 11:47 
Subject:[sqlalchemy] odd adjancency list w/ join_depth behavior
From:Kapil Thangavelu (kapi@gmail.com)
Date:11/29/2007 09:25:00 AM
List:com.googlegroups.sqlalchemy
Attachments:

hi folks,

i seem to be running into a bug or misconfiguration with sqlalchemy's tree handling.. the table and mapping themselves seem fairly innocuous

concepts_table = Table("concepts", metadata, Column("id", types.Integer, primary_key=True), Column("name", types.Unicode, nullable=True), Column("parent", types.Integer, ForeignKey(" concepts.id") ) )

class Concept( object ): pass

mapper(Concept, concepts_table, properties={ 'children': relation(Concept, cascade="all", backref=backref("parent_node", remote_side=[concepts_table.c.id]),

collection_class=attribute_mapped_collection('name'), lazy=False, join_depth=3)})

the odd part is if i specify any join_depth i got an error, if i leave it off its fine. i'm still curious to find out what causes the error and if its a bug or just misconfiguration on my part.

i'm attaching a script which demonstrates the issue, and a contextual traceback (ipython) of the error.

thanks,

kapil