mycode like: department_table=Table('department',medadata, Column('id',Integer,primary_key=True), Column('name',String (64),nullable=False,unique=True), ) class Department(object):pass
doctor_table=Table('doctor',medadata, Column('id',Integer,primary_key=True), Column('name',String(32),nullable=False), Column('department_id',Integer,ForeignKey ('department.id'),nullable=False), ) class Doctor(object):pass Department.mapper=mapper(Department,department_table,properties={ 'doctors':relation(Doctor,backref='department'), }) d=Doctor() why a no have attribute "department"? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---