[sqlalchemy] Re: tracking parents, names

2008-08-20 Thread Martijn Faassen
Hey, Michael Bayer wrote: [snip] The part missing for me here is that bar, if its a MappedCollection, is not itself a mapped object in the same sense that foo or baz is. Keep in mind that a SQLAlchemy relation looks like: mapped class - collection - mapped class - (etc.) Yes,

[sqlalchemy] Re: tracking parents, names

2008-08-18 Thread Martijn Faassen
Hey Michael, Thanks for the helpful answer. Michael Bayer wrote: [snip] (after I've reread the above two paragraphs many times it seems like the idea is that the target object doesn't know anything about the name of the relation in which its collected). The idea is that if the object

[sqlalchemy] Re: tracking parents, names

2008-08-18 Thread Michael Bayer
On Aug 18, 2008, at 11:42 AM, Martijn Faassen wrote: The idea is that if the object graph says: foo.bar.baz that'll be: bar.__name__ == 'bar' bar.__parent__ is foo baz.__name__ == 'baz' baz.__parent__ is bar In this case: foo.bar[key] it'll be: bar[key].__parent__ is foo.bar