Hi,
 I have the following tables:

rcpt_group_asoc = Table("mailing_rcptgroup_rcpts", Base.metadata,
                Column('rcpt_id', Integer, ForeignKey('mailing_rcpt.id')),
                Column('rcptgroup_id', Integer, 
ForeignKey('mailing_rcptgroup.id')))


class Rcpt(Base):
    __tablename__ = 'mailing_rcpt'

    id = Column(Integer, primary_key=True)

    mail_addr = Column(String(128+256), nullable=False)
    rcpt_groups = relationship("RcptGroup", secondary=rcpt_group_asoc,
                                backref="rcpts")

class RcptGroup(Base):
    __tablename__ = 'mailing_rcptgroup'

    id = Column(Integer, primary_key=True)
    name = Column(String(64), nullable=False, unique=True)

I'm trying to do:


group = db.RcptGroup.__table__
rcpt = db.Rcpt.__table__
print group.join(rcpt)

And got:

ArgumentError: Can't find any foreign key relationships between 
'mailing_rcptgroup' and 'mailing_rcpt'.


I can't find the error in my model definition.

Regards,
  Diego

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/sqlalchemy/-/keQCxERRA9AJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to