Re: [sqlalchemy] Setting up indexes in __table_args__ that depend on columns created in __declare_first__

2021-12-14 Thread Mike Bayer
Hi Randy! inside of __declare_first__() the table is ready, you can just set it up def __declare_first__(cls): Index("my_idx", cls.__table__.c.colname) have a great holiday season! - mike On Tue, Dec 14, 2021, at 4:32 PM, 'Randy Syring' via sqlalchemy wrote: > I'm trying to create a

[sqlalchemy] Setting up indexes in __table_args__ that depend on columns created in __declare_first__

2021-12-14 Thread 'Randy Syring' via sqlalchemy
I'm trying to create a mixin that will setup FK columns that are dynamically named based on the name of the parent as opposed to a static name like `parent_id`. If was going to do the latter, I could easily use `declarted_attr` but since I want the former, I thought I could use

Re: [sqlalchemy] How to SELECT computed data using SQLAlchemy?

2021-12-14 Thread 'Daniel Grindrod' via sqlalchemy
That worked brilliantly, thanks so much for your help! Very much appreciated :) On Tuesday, 14 December 2021 at 18:16:02 UTC Mike Bayer wrote: > > > On Tue, Dec 14, 2021, at 12:26 PM, 'Daniel Grindrod' via sqlalchemy wrote: > > Hi Michael, > > Thanks for such a quick reply. > I enjoyed reading

Re: [sqlalchemy] How to SELECT computed data using SQLAlchemy?

2021-12-14 Thread Mike Bayer
On Tue, Dec 14, 2021, at 12:26 PM, 'Daniel Grindrod' via sqlalchemy wrote: > Hi Michael, > > Thanks for such a quick reply. > I enjoyed reading it! I actually inherited this API (I swear I'm not just > making excuses!) from a colleague who left a few months earlier, so it's very > much been a

Re: [sqlalchemy] How to SELECT computed data using SQLAlchemy?

2021-12-14 Thread 'Daniel Grindrod' via sqlalchemy
Hi Michael, Thanks for such a quick reply. I enjoyed reading it! I actually inherited this API (I swear I'm not just making excuses!) from a colleague who left a few months earlier, so it's very much been a case of 'Figuring it out as I go along'. Apologies for the incomplete code - despite it

Re: [sqlalchemy] How to SELECT computed data using SQLAlchemy?

2021-12-14 Thread Mike Bayer
On Tue, Dec 14, 2021, at 5:40 AM, 'Daniel Grindrod' via sqlalchemy wrote: > Hi all, > > I'm working on a REST API which is built using Flask-SQLAlchemy and > Connexion. I'm fairly new to SQLAlchemy, but it's been brilliant so far :) > This API uses SQLAlchemy 1.3.16, and connects to an Oracle

[sqlalchemy] How to SELECT computed data using SQLAlchemy?

2021-12-14 Thread 'Daniel Grindrod' via sqlalchemy
Hi all, I'm working on a REST API which is built using Flask-SQLAlchemy and Connexion. I'm fairly new to SQLAlchemy, but it's been brilliant so far :) This API uses SQLAlchemy 1.3.16, and connects to an Oracle Database (12c 12.1.0.1.0 64bit).