Re: [sqlalchemy] Dynamically change table name to select from for query

2018-03-03 Thread Mike Bayer
the canonical solution is the"entity name" pattern at https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/EntityName, however this does establish subclasses-per-table even though it is automated. To truly use just a single class, the caveat is that the identity map will not have any cue to s

[sqlalchemy] Dynamically change table name to select from for query

2018-03-02 Thread Stanislav Lobanov
Hello! I have a database with 10 tables with same structure. This structure of a tables are always the same. I want to be able to query this tables using one declarative mapper instead of 10 similar mappers, but to do so i need a way to change table name somehow. Desired code: class T(Base):