[sqlalchemy] Synchronizing data, want to track what has changed. Advice please.

2011-09-27 Thread Brian
hello all, I'm grabbing data from a Student Information System (SIS) about students and then saving that data in a local database. I then query my local database to create/modify/disable accounts in Active Directory and Google Apps. What I've been doing so far is the following: Set all

Re: [sqlalchemy] Synchronizing data, want to track what has changed. Advice please.

2011-09-27 Thread Michael Bayer
On Sep 27, 2011, at 11:42 AM, Brian wrote: hello all, I'm grabbing data from a Student Information System (SIS) about students and then saving that data in a local database. I then query my local database to create/modify/disable accounts in Active Directory and Google Apps. What

Re: [sqlalchemy] Synchronizing data, want to track what has changed. Advice please.

2011-09-27 Thread Brian
I'm not sure how I could do that because I'd want to set active to 0 only on the students that are no longer going to school here. Maybe merge isn't the right thing to do, or maybe I need to rethink my algorithm. The bottom line is I need to know what records get added to the local database

Re: [sqlalchemy] Synchronizing data, want to track what has changed. Advice please.

2011-09-27 Thread Michael Bayer
SQLA itself can only give you what's changed in memory. so if you had an X(), and you set X.y to bar where it used to be foo, before a flush you can see that happen with session.dirty and attributes.get_history(x, y). I don't entirely understand the actual task here but if it has to do with

Re: [sqlalchemy] Synchronizing data, want to track what has changed. Advice please.

2011-09-27 Thread Brian
Thanks for your responses. I've been doing quite a bit of probing and I think I have what I need now to get the job done. Sorry for the confusion, I wasn't being very clear. The problem with setting active to 0 after the fact stems from the fact that I'm only querying each database for the