Hi all, I've a project that stores some data in a RDBMS and uses zope.sqlalchemy. I'd like to expose these objects with a speaking url like Plone/folder/db_category1/db_object. Does anybody know a good approach to do that?
I tried to solve it with an IPublishTraversal adapter which returns the right object and makes sure they provide ILocation. This works fine, even view lookup on the leaf object. To support traversal in templates (e.g. 'context/main_template/macros') I added a zope.traversal.interfaces.ITraversable adapter that uses aq_acquire() which also works well due to the __parent__ pointers. But there is much missing that would have been provided either via Zope2 Acquisition (e.g. getCurrentSkinName()) or OFS.Traversable/SimpleItem/OFS.interfaces.ITraversable (absolute_url(), getPhysicalPath(), restrictedTraverse()) Implementing OFS.interfaces.ITraversable seems to be not sensible. Inheriting from Acquisition.Implicit is not possible due to metaclass conflicts. Is it possible to put them into the acquisition chain without inheriting from Acquisition. What I could think of is to overwrite __getattr__() in my last ZODB-based Object and from there on return acquisition aware proxy objects. Maybe there is a away to publish this last ZODB based folder (despite the additional path elements) and have access to the remaining path. Thanks, ..Carsten -- Carsten Senger - Schumannstr. 38 - 65193 Wiesbaden [email protected] - (0611) 5324176 PGP: gpg --recv-keys --keyserver hkp://subkeys.pgp.net 0xE374C75A
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Product-Developers mailing list [email protected] https://lists.plone.org/mailman/listinfo/plone-product-developers
