hey there -
I don't know what that is. Can you share the complete stack trace? that would
show me where it is misinterpreting something. thanks!
On Tue, Dec 15, 2020, at 7:48 AM, Larry Martell wrote:
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sqlalchemy/CACwCsY6OEAHpsPw_rV28M%3D4qprywhgK%2BLFiyejEb_9tNDeLv4A%40mail.gmail.com.
>
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/sqlalchemy/4d9396b1-e061-4747-9664-5a8806b35dfb%40www.fastmail.com.