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