[sqlalchemy] Re: Unable to define a self-referential table in declarative style

2009-08-24 Thread Kees van den Broek
That's it. Thanks! Although it still took me a while to figure out how to do it. Just to have a complete example in the mailinglist, I'll copy paste what I have now: class Category(DeclarativeBase): __tablename__ = 'category' category_id = Column(Integer, autoincrement=True, primary_key=

[sqlalchemy] Re: Unable to define a self-referential table in declarative style

2009-08-24 Thread Michael Bayer
you're missing a ForeignKey column back to your category_id. Kees van den Broek wrote: > > Hi, > > This is a table setup in declarative style: > > class Category(DeclarativeBase): > __tablename__ = 'category' > category_id = Column(Integer, autoincrement=True, > primary_key=True) > n

[sqlalchemy] Re: Unable to define a self-referential table in declarative style

2009-08-24 Thread Tomasz Jezierski - Tefnet
Dnia 2009-08-24, Pn o godzinie 12:35 -0700, Kees van den Broek pisze: > Hi, > > This is a table setup in declarative style: > > class Category(DeclarativeBase): > __tablename__ = 'category' > category_id = Column(Integer, autoincrement=True, > primary_key=True) > name = Column(Unicod