Re: [sqlalchemy] Re: relation for single table, not joined

2010-02-20 Thread Michael Bayer
On Feb 19, 2010, at 5:05 PM, Kent wrote: I used department as a dummy type object, but I meant it to be an illustration of what I am trying to accomplish. I was hoping the illustration would spark a oh, I know what he's trying to do... no, do it this way... when merge() recurses to list

[sqlalchemy] Re: relation for single table, not joined

2010-02-19 Thread Kent
In case the point wasn't clear, I'd like merge() to be able to figure out which items to add, update and, esp, delete without needing to do that programatically myself. On Feb 19, 7:26 am, Kent k...@retailarchitects.com wrote: Suppose I have a database table, as an example, employee that has a

[sqlalchemy] Re: relation for single table, not joined

2010-02-19 Thread Kent
In my example, there is only *one* table, employee. Yes, dept would be a string column on employee. The catch is there is *no* department table. But I'd like to be able to call merge() given a list of employees for a given dept and have it figure out which need to be added, updated and deleted.

Re: [sqlalchemy] Re: relation for single table, not joined

2010-02-19 Thread Michael Bayer
On Feb 19, 2010, at 11:55 AM, Kent wrote: In my example, there is only *one* table, employee. Yes, dept would be a string column on employee. The catch is there is *no* department table. but what does this mean then ? department.dept = 'PAYROLL' department.employees = [ empa, empb, empc

[sqlalchemy] Re: relation for single table, not joined

2010-02-19 Thread Kent
I used department as a dummy type object, but I meant it to be an illustration of what I am trying to accomplish. I was hoping the illustration would spark a oh, I know what he's trying to do... no, do it this way... when merge() recurses to list relation, how does it build the list of things to