[sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-21 Thread Peter Schutt
A couple of typos found re-reading my post, the Contribution.contact_id with a foreign key definition should be `contact_id = Column(Integer, ForeignKey('civicrm_contact'), nullable=False)`, I left out the closing parenthesis to the ForeignKey constructor. Also, the very last line, I didn't cl

[sqlalchemy] Re: Translating sql query to sqlalchemy

2019-08-21 Thread Peter Schutt
Hi Ira, For example Integer(xx) says that Integer cannot have parameters and > Tinyint seems not to exist. I'm aware of sqlacodegen, although never had the need to use it myself. Those issues sound to me like it is using the mysql dialect types, not the standard sqlalchemy types. For example

Re: [sqlalchemy] Explicit Column Combination vs Implicit?

2019-08-21 Thread Michael P. McDonnell
Okay - I gotcha! That makes perfect sense too. It also means that my (eventual) work around worked: class Round(Base): __table__ = round_join game_id = column_property( round_table.c.game_id, game_table.c.id, game_language_table.c.game_id) On Wed, Aug 21, 2019 at 2:21 PM Mike Baye

Re: [sqlalchemy] Explicit Column Combination vs Implicit?

2019-08-21 Thread Mike Bayer
On Wed, Aug 21, 2019, at 1:46 PM, Michael P. McDonnell wrote: > Hey team - > > I've went through the docs, and likely because I'm a bit of a hack - I'm > finding it hard to find my answers (because I'm not sure what I'm > specifically looking to "do" other than "make it work") > > So I have

[sqlalchemy] Explicit Column Combination vs Implicit?

2019-08-21 Thread Michael P. McDonnell
Hey team - I've went through the docs, and likely because I'm a bit of a hack - I'm finding it hard to find my answers (because I'm not sure what I'm specifically looking to "do" other than "make it work") So I have the following situation: I have a GAME table (with a corresponding LANGUAGE table