Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install archetypes.fieldtraverser

How to install archetypes.fieldtraverser

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install archetypes.fieldtraverser
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.4.4 Available View build log
Windows (64-bit)
0.4.4 Available View build log
Mac OS X (10.5+)
0.4.4 Available View build log
Linux (32-bit)
0.4.4 Available View build log
Linux (64-bit)
0.4.4 Available View build log
 
License
GPL
Lastest release
version 0.4.4 on Jan 5th, 2011

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

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.