[Zope] PluggableBrains weirdness

Dieter Maurer dieter at handshake.de
Sun Jul 25 18:12:40 EDT 2004


Michael Ekstrand wrote at 2004-7-23 13:54 -0500:
>Another question about these PluggableBrains I'm developing for my 
>application.
>
>I haven't been able to find much definitive, complete documentation on 
>the subject anywhere. So I'm pretty much figuring it out by trial-and 
>error.
>
>My class has an __init__ method like so:
>
>    def __init__(self):
>        "Initialize class"
>        self._badmsgs = {}   # function: reason
>        # Validation info...
>        self._invalidated = False    # Have we been specifically 
>invalidated by a set function?
>        self._valid = True           # Are we valid?
>
>When I access a query using this Brains class, I get an AttributeError 
>complaining about _badmsgs. What is causing this? It occurs even if I 
>declare
>_badmsgs = {}

A well known (extremely old collector entry) misfeature of
the "record" class used to implement Z SQL Method result rows:
their instances do not have a "__dict__" and therefore cannot
store attributes other than the result fields.

-- 
Dieter


More information about the Zope mailing list