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 products.references

How to install Products.References

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

A Reference is a Zope object refering to another Zope object, called its Target. The target it identified by a path relative to the parent of the Reference. It is resolved into the target through restrictedTraverse.

The attribute Target as well as the method getTarget give the target object.

A Reference behaves almost like its target. It appears to have (most of) its attributes and methods. In this sense, it is very similar to Shane's Symlink product. Unlike a Symlink, however, a Reference has its own id, title and management facilities and therefore can be distinguished from the refered to object. This is very difficult for a SymLink; therefore, I consider Reference safer.

On lookup, a Reference prefers its own attributes over those of the target. This means that it behaves as a reference and partially as its target.

Caveats

There are security weaknesses: the setDefaultAccess('allow') and the declareObjectProtected('Access contents information') of Reference spill over to the target when accessed through the reference. This is a side effect of Zope's (strange) security policy.

In order to ensure manageability of the Reference, __before_publishing_traverse__ and __bobo_traverse__ are not relayed to the target.

It is very difficult (I think impossible) to emulate the special treatment of Python Methods by acquisition. The current implementation tries hard to emulate enough that Python Scripts (and similar objects) get correct bindings. However, the acquisition context is otherwise different from how it were when directly called.

Zope toolkit (aka Zope3) adapters (this includes views) may not work on references as you expect because the adapters see the interfaces implemented by the reference itself, not those of the refered to object.

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:3

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.