In article <382B335F.3160393A@digicool.com>, Michel Pelletier <michel@digicool.com> wrote:
Hmm.. this sounds like more of a bug in ZClasses to me than OMs, but I see your point below, it's really about wanting to override __getattr__
Right.
It was easy to hack around this, but it sure would be nice if the tree-ObjectManager *could* support getattr. The inability to override __getattr_ on Persistent subclasses keeps biting me (and others, from what I see on the lists) again and again. It would be *really* nice if this could be fixed. I'd even be happy with something like "You can't override __getattr_, but if you define __foo_getattr__, persistent will try it before returning AttributeError".
I suspect jim would frown on another hook, we're trying to avoid as many new hooks as possible, especialy ones that may have a per hit or per traversal penalty. Perhaps I haven't thought about your idea enough though.
Right. I'm just saying that if there does have to be a gross hack, I could accept that. It would be nice if it were simply possible to override __getattr__ in the usual manner. Or in an unusual manner, for that matter :-). So long as there's some way, I'm happy :-)