Re: [sqlalchemy] AttributeError: type object has no attribute 'foreign_keys'

2020-12-15 Thread Larry Martell
On Tue, Dec 15, 2020 at 10:21 AM Mike Bayer wrote: > > > > On Tue, Dec 15, 2020, at 9:17 AM, Larry Martell wrote: > > Yes, I have: > > class BusinessArea(Base): > . > . > . > Contact = relationship('Contact', secondary='BusinessAreaContact') > > Is there anything I can do now to be able to

Re: [sqlalchemy] AttributeError: type object has no attribute 'foreign_keys'

2020-12-15 Thread Mike Bayer
On Tue, Dec 15, 2020, at 9:17 AM, Larry Martell wrote: > Yes, I have: > > class BusinessArea(Base): > . > . > . > Contact = relationship('Contact', secondary='BusinessAreaContact') > > Is there anything I can do now to be able to proceed with my development? Ah I in fact noticed something

Re: [sqlalchemy] AttributeError: type object has no attribute 'foreign_keys'

2020-12-15 Thread Larry Martell
Yes, I have: class BusinessArea(Base): . . . Contact = relationship('Contact', secondary='BusinessAreaContact') Is there anything I can do now to be able to proceed with my development? On Tue, Dec 15, 2020 at 9:07 AM Mike Bayer wrote: > > Thanks for that. > > So I think I'm going to make a

Re: [sqlalchemy] AttributeError: type object has no attribute 'foreign_keys'

2020-12-15 Thread Mike Bayer
Thanks for that. So I think I'm going to make a small change here because I'm amazed that this is the error you're getting, for something that is likely a very common mistake and we should be checking for this. It seems likely, as I can reproduce this exactly here, that somewhere in your

Re: [sqlalchemy] AttributeError: type object has no attribute 'foreign_keys'

2020-12-15 Thread Larry Martell
File "/var/task/common/repository.py", line 74, in delete_all res = self._session.query(model).delete() File "/opt/python/sqlalchemy/orm/session.py", line 1558, in query return self._query_cls(entities, self, **kwargs) File "/opt/python/sqlalchemy/orm/query.py", line 191, in __init__

Re: [sqlalchemy] AttributeError: type object has no attribute 'foreign_keys'

2020-12-15 Thread Mike Bayer
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__ =

[sqlalchemy] AttributeError: type object has no attribute 'foreign_keys'

2020-12-15 Thread Larry Martell
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,