Discussion:
[Erp5-dev] ZSQLCatalog and __getitem__
Leonardo Rochael Almeida
2010-04-16 06:09:44 UTC
Permalink
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

Loading...