[ZPatterns] error when changing the Base ZClass for a Rack

John Eikenberry [email protected]
Mon, 3 Dec 2001 15:42:15 -0800


We're finially upgrading our Zope from 2.2.5 to 2.4.3 and we just ran into
the same problem. It seems to only be a problem if you use an SQL backend.
DataSkins don't have _setId or getId implemented. My guess is that it was
assumed you'd mix in SimpleItem or some other Zope class.

Our hack to fix this enough to get some other testing done was to add them
to our subclass of DataSkin. Here's what we added:

    def _setId(self, id):
        self._v_name =3D id

    def getId(self):
        return self._v_name

I used the volitile attribute instead of __name__ to keep it from showing
up the CHANGED_ATTRS() list. Anyone see any problems with this?=20

Joachim Schmitz wrote:

> Hi,
>=20
> this is a resend of a mail from last week:
>=20
> If I store my persistent items in a SQL-database, I still have to specify=
 a
> ZClass for the storage, eventhough it seams it can be a dummy. Cause I ju=
st
> specified an existing ZClass from another project for a test.
> After I got that working, I thought it would be better to create a
> DummyZClass for that.
>=20
> But when I  change the base ZClass of my specialist rack, I get the
> following error, when doin a getItem to that rack:
>=20
> Error type: AttributeError
> Error value: _setId
>=20
> File Zope-2.4.1//lib/python/Products/ZPatterns/Specialists.py, line 34, i=
n getItem
>     (Object: ProviderContainer)
>   File Zope-2.4.1//lib/python/Products/ZPatterns/Rack.py, line 59, in get=
Item
>     (Object: ProviderContainer)
>   File Zope-2.4.1/lib/python/Products/ZPatterns/Rack.py, line 96, in retr=
ieveItem
>     (Object: ProviderContainer)
>   File Zope-2.4.1/lib/python/Products/ZPatterns/Rack.py, line 236, in _Ra=
wItem
>     (Object: ProviderContainer)
> AttributeError: (see above)
>=20
>=20
>=20
>=20
> Mit freundlichen Gr=FC=DFen
>=20
> Joachim Schmitz
>=20
> AixtraWare, Ing. B=FCro f=FCr Internetanwendungen
> H=FCsgenstr. 33a, D-52457 Aldenhoven
> Telefon: +49-2464-8851, FAX: +49-2464-905163
>=20
>=20
>=20
> _______________________________________________
> ZPatterns mailing list
> [email protected]
> http://www.eby-sarna.com/mailman/listinfo/zpatterns

--=20

John Eikenberry [[email protected]]
______________________________________________________________
"A society that will trade a little liberty for a little order
 will deserve neither and lose both."
                                          --B. Franklin