Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Archetypes fieldtraverser

Project Description

Overview

The archetypes.fieldtraverser is used to traverse to an Archetypes field and access its storage.

It patches Products.Archetypes so that it uses the fieldtraverser for access to fields.

Use Cases

  • Access to images, files or other binary data via AnnotationStorage instead of traditional AttributeStorage. archetypes.fieldtraverser eliminates the need to hack __bobo_traverse__ for this. Advantage: When accessing objects with binary data stored in an AttributeStorage, much binary data chunks are loaded regardless if they are used. When doing this quite often the ZODB is unnecessarily stressed.
  • You can use archetypes.fieldtraverser for simple Web Services which return just the content of Archetypes fields without the HTML rendered by widgets.
  • Impress your friends by easily accessing field-contents via URLs.

Usage

In an URL this traverser can be used to access a fields data by use of the fieldname and the storage variant if needed (such as image sizes):

obj/++atfield++FIELDNAME

or

obj/++atfield++FIELDNAME-STORAGENAME

Example

To access an original image from a field named ‘photo’:

obj/++atfield++photo

To access its thumbnail with size named ‘thumb’:

obj/++atfield++photo-thumb

Dependencies

Products.Archetypes

Installation

Install like any other Plone egg and import the GenericSetup profiles in ZMI, portal_setup.

Known Issues

The ImageWidget, FileWidget and RichWidget are patched to use the ++atfield++FIELDNAME notation for accessing binary contents. This patch is done via updating the fields’ _properties which is then copied in the concrete schematas. But our default patch mechanism does not affect ATContentTypes (and possibly other ConentTypes too) because they are loaded by Zope BEFORE the patches are applied. This happens also for eggified products in Plone3.2 because Products.ATContentTypes is being recognised as a Product by Zope/Five because of the “Products” namespace. Therefore Products.ATContentTypes is loaded BEFORE any eggs are loaded. So we have to patch the concrete ATContentTypes too. See patch.py for more information.

Please note that RichWidget has the ability to upload and download files, and therefore we also provide custom fieldtraverser aware widgets. BUT the upload/download feature is deactivated by default in the RichWidget templates and settings. The RichWidget patching is done just for completeness.

So, if you include your own Products or eggs in the “Products” namespace you’ll also have to patch your content types to use our fieldtraverser aware widgets. With this in mind using this product should not be a problem.

For your pleasure

An “Easter egg” can be found when opening “++resource++plone.jpg” in your Plone site. For more information read archetypes/fieldtraverser/tests/plone.jpg.CREDITS

Credits

Release History

Release History

This version
History Node

0.4.4

History Node

0.2.1

History Node

0.2

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
archetypes.fieldtraverser-0.4.4.tar.gz (37.2 kB) Copy SHA256 Checksum SHA256 Source Dec 9, 2008

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting