I've got a somewhat oddball situation, and I'm hoping for some pointers
to the right sqlalchemy features to handle this.  Or, failing that,
hints as to the places I'm going to need to write code to compensate
for the weirdness I have to deal with.

The situation is that I get periodic copies of a set of database tables.
In my local database, I need to provide supplemental data that is
maintained only in my copy.

In my application library, I need to support two models: a model that
includes only the data of which I get periodic copies, and a second
model that includes my supplemental data.  So, object wise what I think
I want to have is a set of objects for the imported data, and then
a second set of objects that subclasses the first and extends them.
(ex: a "Publication" object, and then an "ExtendedPublication" object).
So I have two sets of tables, the base tables (whose schema I would
prefer not to touch), and a second set of parallel tables containing
my local data.  On import, I just drop and replace the base tables,
leaving my tables untouched.

Right now I'm playing with mapper inheritance.  The first stumbling
block I've come to is the case where the local table doesn't yet have
a row for the object from the base table.  In that case, a query on my
subclassed object returns nothing.  Do I need to write an import program
that creates rows in the local tables for any items in the imported data
that don't yet have them?  That strikes me as rather fragile.  Is there
a way to automate the creation of the local table row with default values?

Or am I approaching this all wrong?

--RDM

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to