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 delete"? If it has already eagerly loaded this relation, it doesn't need to go back to the database, correct? Is it essentially looping through all the items in the eagerly-loaded relation and if the merging copy doesn't contain it, it moves it to the list of items to delete? Thanks for you help, as always. On Feb 19, 3:11 pm, Michael Bayer <mike...@zzzcomputing.com> wrote: > 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 ] > > empa, empb, empc are mapped to "employee", correct ? what is "department" > ? is that also a row in "employee" ? or just a dummy object ? if the > latter, then no, merge() requires a mapped object as its argument, and you > should create some kind of function that unwraps the ORM objects from your > dummy "department" object and passes them to merge() with the desired state. > > OTOH if the case here is, you'd like a string column on a mapped instance to > spawn itself into some kind of object or collection, merge() has nothing to > do with that, you'd implement that as a def on your class. -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalch...@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.