I have this model class:

class BusinessAreaContact(Base):
    __tablename__ = 'BusinessAreaContact'

    businessAreaID = Column(ForeignKey('BusinessArea.businessAreaID'),
primary_key=True, nullable=False)
    contactEmail = Column(ForeignKey('Contact.contactEmail'),
primary_key=True, nullable=False)

If I try and delete from the table with:

session.query(BusinessAreaContact).delete()

I get:

AttributeError: type object 'BusinessAreaContact' has no attribute
'foreign_keys'

I have other models where I define FKs in the same way, and I do not
get that error with those. What makes this model different and how can
I fix this error?

Thanks!

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/CACwCsY6OEAHpsPw_rV28M%3D4qprywhgK%2BLFiyejEb_9tNDeLv4A%40mail.gmail.com.

Reply via email to