[Zope] ZSQL Pluggable brains broke in later Zope, can't add instance attributes

Chris McDonough chrism@digicool.com
Thu, 5 Jul 2001 13:02:24 -0400


Hi Brad,

Is eventday acquired or something?

----- Original Message -----
From: "Brad Clements" <bkc@murkworks.com>
To: <zope@zope.org>
Sent: Thursday, July 05, 2001 1:14 PM
Subject: [Zope] ZSQL Pluggable brains broke in later Zope, can't add
instance attributes


> I've been using a pluggable brain with ZSQL methods to inject an instance
attribute, like
> this:
>
>
> class   PackageEvent:
>     """Package Event Pluggable Brain"""
>     def __init__(self):
>         """initialize"""
>         self.__dict__['eday'] = self.eventday()
> #        self.eday = self.eventday()
> #        setattr(self,'eday',self.eventday())
>
> <snip>
>
> The first method (using __dict__) used to work on 2.2, but now fails on
2.3.3
>
> I've tried the commented out methods as well.
>
> I get an attributeError when any of the above three methods are
encountered.
>
> I believe some new ExtensionClass magic is causing this to fail. Record.c
is too
> complicated for me to figure out.
>
> Do I need a self.__of__() something to do this?
>
> I can't use an instance method because I need to use  <dtml-if first-eday>
in my DTML
> methods.
>
> <dtml-var first-eventday> fails of course because eventday is a bound
method, not a
> string.
>
> Any suggestions?
>
> thanks
>
>
> Brad Clements,                bkc@murkworks.com   (315)268-1000
> http://www.murkworks.com                          (315)268-9812 Fax
> netmeeting: ils://ils.murkworks.com               AOL-IM: BKClements
>
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>