[Erp5-dev] ZSQLCatalog and __getitem__

Leonardo Rochael Almeida leonardo at nexedi.com
Fri Apr 16 08:09:44 CEST 2010


Hi,

For some time now ZSQLCatalogs had a feature that allowed a developer to
access it as a dictionary whose keys where the UIDs of the objects. The
respective ZSQLCatalog record (ZSQL brain) would be returned.

In practice it seems this feature seemed to hurt more than it helped, as
it caused strange errors when .(un)restrictedTraverse was used to try to
access a non-existing object in the acquisition context of the
ZSQLCatalog in Zope 2.8

In Zope 2.12 this got worse, as the strange errors would happen on all
attempts to use .unrestrictedTraverse() in the context of the
ZSQLCatalog if the traversed path segment wasn't in the proper format
for the ZSQL method used to do the lookup

So we removed this feature from ZSQLCatalog trunk and added it as an
explicit method: getRecordForUid.

Are there any users of ZSQLCatalog using this specific feature? Would
you miss it terribly if it was replaced by a simple method?

Regards,

Leo




More information about the Erp5-dev mailing list