On Fri, 2002-03-29 at 03:58, Chuck Esterbrook wrote: > Some comments on the patch itself: > > - Kill the delattr(). The setattr() immediately afterwards is > sufficient.
Right. > - In updateReferencingListAttrs() the "obj = self.valueForAttr(attr)" > will pull in an obj that is not yet in memory. Which then will pull in > the lists (since it asked to removeObjectFromListAttrs()) which results > in a lot of work for nothing. We can probably check for this via the > store's _objects dictionary and avoid this extra "thrashing". Yes, I was aware that this would be (unnecessarily) pulling in a few objects from the database -- I just didn't dig deeply enough to figure out how to find these objects in the cache. > - Likewise the removeObjectFromListAttrs() doesn't have to look at a > list unless it's in memory (e.g., not None) so it should check the raw > attribute instead of valueForAttr(). Good point. > - We have to make some test cases around this. Like delete a listed > object then add a new object to the list and save changes. Should work, > but you never know until you try... And delete a listed object, add a > new object to the list, delete another listed object, add an existing > object to the list, and save changes. (See MiddleKit/Tests/ and be sure > to run Test.py) Ok, I'll try to add a few test cases. > But the patch is definitely clever. It relies on the fact that objects > in lists always have "back refs" to the objects containing them. And > you obviously "get" the whole klass and attr definitions idea to have > written this. Like you, I find I'm using the object hierarchy for a lot more than object persistence, including (in some cases) generating html forms generically. I've have quite a collection of extra columns in my Classes.csv file, too. :) > If you wanna take a crack at the above improvements, it would be much > appreciated and you would learn even more about MK internals. ;-) Ok -- why don't you hold off on integrating my patch, and I'll see if I can improve it a bit more w.r.t. the above suggestions. > I did my part today adding indexes and speeding up fetches. :-) Cool. Thanks! peace, Jason _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss
