I have just inherited an extreemly legacy application (built on windows 95 - Magic7 for the connoisseurs) now backed against a recentish mssql db (2012). That's not the db system it was first designed on, and it thus comes with some seriously odd design for tables.
I'm looking for a python ORM to help me talk to this thing easily. Namely, I'm after an ORM that can easily, for instance, merge 2 tables as if they were one.
For instance I may have tables BILLS and BILLS_HISTORY, with different column names, and perhaps even different column types, so different strictly speaking, but sementically containing the same information (same number of columns, sementically identical values).
I'm looking for an ORM that lets me define only one Bill object, that maps to both tables, and that gives me the right hooks to decide where things go, and how to write them when tweaks are needed.
Another Example : say I have an object called a good. If a good is finished, it goes in the GOODS table, if it is not finished, it goes in the GOODS_UNFINISHED table. I'm looking for a goods object that can read both tables, and give me a finished property set to the right value depending which table it comes from  (and  with the hooks to change it from one table to the other if the property is set in some way).
I'm fine with python, but I have not done much such db work before so my knowledge is limited there. I could, and might end up writing my own tailor made ORM, but that seems like a waste of time for something that will be thrown away in 6 months when the full transition is done to something new. Does anyone know of an ORM with such capabilities ? I'm planning to study ponyORM and SQLAlchemy, but I have a feeling it will take me a few days to come to a conclusion wether they are suitable for my use case. So I thought I'd ask the community too ...
Cheers
For the record I've ended up with a hybrid approach using sqlalchemy.
Sqlalchemy was not flexible enough to do everything I wanted out of the box in a non verbose fashion, but had the required functionality to get a fair bit of the way along if one took the pain of writing explicitely everything needed. So I wrote a program that generates about 6000 lines of sqlalchemy code in order to have a 1 to 1 mapping between sqlalchemy objects to tables in the way required (basically defining everything explicitely for sqla). Sqlalchemy has a lot of hooks during autoload, but I have found it hard/impossible to leverage different hooks and set fine grained behaviour at each hook at the same time, that's why I went the automated explicit way.
On top of these sqlalchemy objects, I've written objects that wraps them to hide the "which table" traffic control things. A bit of a kludge and I think that I could have done something with type heritance and sqlachemy objects, but time was passing and I only needed very little functionality or maintainability in that layer, so just charged ahead.
Looking for a particular python ORM