Hi,

There are two tables which have many-to-many relationship using a secondary 
table with two foreign keys. Two tables are user and addr, and secondary 
table is residence.

When generating python models using Sqlacodegen, it did not output desired 
code as below.

class Residence(Base):
    __tablename__ = 'Residence'

    res_id = Column(Integer, primary_key=True)
    res_user_id = Column(ForeignKey(u'user.user_id'), index=True)
    res_addr_id = Column(ForeignKey(u'addr.addr_id'), index=True)


    res_user = relationship(u'User')
    res_addr = relationship(u'Addr')


When accessing Residence.res_user, an error occurs 'Residence object has no 
attribute  res_user'.   Please give me a hint!


Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to