Re: [sqlalchemy] Using Abstract Base Classes with ORM Table Classes

2021-03-16 Thread Richard Damon
First, just recently switched my developement form 1.3 to 1.4 based on comments of time line, since I suspect I won't be done till next year, will likely be releasing with 2.0. (I set the migration warnings described in the porting guide). Not sure I can use the class decorator, as I am using a

Re: [sqlalchemy] Using Abstract Base Classes with ORM Table Classes

2021-03-15 Thread Mike Bayer
you no longer have to use DeclarativeMeta at all, you can use a class decorator: https://docs.sqlalchemy.org/en/14/orm/mapping_styles.html#declarative-mapping-using-a-decorator-no-declarative-base if you are on 1.3, there's a way to get the same effect in 1.3 using the instrument_declarative

[sqlalchemy] Using Abstract Base Classes with ORM Table Classes

2021-03-14 Thread Richard Damon
I have a lot of tables that have some similar functionality that I would like to factor out into a base mix-in class that provides some common methods. Some of these methods will want to use a method that must be defined in the actual table ORM class, and would be an abstract method in the base.