Re: [sqlalchemy] Re: How to make relation to same table

2010-02-24 Thread flya flya
Yes, this is what I wonder, but my code use orm, declarative_base(), not mapper, I write these code follow the document's example, it can't work too, what's wrong with my code? Base = declarative_base() class Page(Base): __tablename__ = 'pages' id = Column(Integer, primary_key=True)

Re: [sqlalchemy] Re: How to make relation to same table

2010-02-24 Thread Michael Bayer
On Feb 24, 2010, at 6:14 AM, flya flya wrote: Yes, this is what I wonder, but my code use orm, declarative_base(), not mapper, I write these code follow the document's example, it can't work too, what's wrong with my code? Base = declarative_base() class Page(Base): __tablename__ =

[sqlalchemy] Re: How to make relation to same table

2010-02-23 Thread Oliver Beattie
You probably want to take a look at http://www.sqlalchemy.org/docs/05/mappers.html#adjacency-list-relationships On Feb 23, 5:42 pm, flya flya flyafl...@gmail.com wrote: here is code: Base = declarative_base() class Page(Base):    __tablename__ = 'pages'    id = Column(Integer,