I'm still having trouble getting an adjacency list relationship to
work within a child class (Department class in this example), and am
hoping someone might offer some insight:

class Node(Base):
    __tablename__ = 'node'
    id = Column(Integer, primary_key=True)
    name = Column(String(100))
    discriminator = Column('discriminator', String(50))

class Department(Node):
    __tablename__ = 'department'
    __mapper_args__ = {'polymorphic_identity': 'department'}
    id = Column(Integer, ForeignKey('node.id'), primary_key=True)
    description = Column(Text)
    parent_department_id = Column(Integer,
ForeignKey('department.id'))
    parent_department = relationship("Department",
 
backref=backref("subdepartments"),
                                     remote_side=id)

Thanks,
Michael Naber

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to