On Mar 26, 2007, at 6:15 AM, Gaetan de Menten wrote:
> > though, as a user, I'd prefer the first solution. > > Wouldn't that be possible? I think it should be. You only need to keep > the deferred approach of the InstrumentedList that I demonstrated in > my patch, so that the whole list is not fetched before we get the > query object, which would ruin the whole idea. Of course it was only a > proof-of-concept patch, but I think it should be fixable. my various issues with the deferred thing are as follows. note that im not putting these out there as "this is why we arent doing it", im putting it out there as "this is why it makes me uncomfortable". the current use case of "has my lazy list been loaded?" is: "addresses" in myobject.__dict__ with deferred list, now we have to have a list element actually present there (but still loaded, maybe not). so detecting when an attribute requires its callable fired off or not gets thorny...also breaks code for those who do it the above way, but also we need to add some new way to accomplish the above, which will probably have to be some messy function call like "attribute_manager.is_loaded (myobject, "addresses")". generally theres all sorts of places where we want to get at the attribute and fire it off, not fire it off (internally known as "passive"), etc. and the awareness of the "deferred" list there would have to be more deeply embedded throughout the attributes module for everything to keep working. so my discomfort grows that we are changing the APIs of attributes.py, probably including its public API, just to suit something that IMHO is strictly for visual appeal. also, while it looks cleaner, there is still a semantic co-mingling that im not very comfortable with. i.e. that a collection of persisted objects on a parent class doubles as a database query object. to me the meaning of those two things is entirely different, and i think the decline of an API starts with minor conflation of concepts. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---