[sqlalchemy] Re: Setting up a self-referential mapper using the declarative layer

2008-12-11 Thread Michael Bayer
On Dec 11, 2008, at 5:50 AM, Andreas Jung wrote: > > This works to some degree: > > class Hierarchies(Base): > __tablename__ = 'hierarchies' > __table_args__ = ( > { 'autoload' : True, }) > > parent_id = Column('parent_id', Integer, > ForeignKey('hierarchies.id')) > > _

[sqlalchemy] Re: Setting up a self-referential mapper using the declarative layer

2008-12-11 Thread Andreas Jung
On 11.12.2008 11:10 Uhr, [EMAIL PROTECTED] wrote: > afaik, u can supply strings instead of real things everywhere in those > arguments.. they are eval()ed against some context at later time. > This works to some degree: class Hierarchies(Base): __tablename__ = 'hierarchies' __table_args

[sqlalchemy] Re: Setting up a self-referential mapper using the declarative layer

2008-12-11 Thread az
afaik, u can supply strings instead of real things everywhere in those arguments.. they are eval()ed against some context at later time. On Thursday 11 December 2008 10:40, Andreas Jung wrote: > Can the decl. layer be used to setup a self-referential mapper like > > > class Foo(Base): > > __