[Zope] accessing attributes of a referenced object via ZPT

Derrick 'dman' Hudson dman at dman13.dyndns.org
Tue Aug 12 17:50:30 EDT 2003


I am trying to make a nice display of some objects using ZPT.  These
objects refer (by storing the path as a string) to other objects and I
want to display an attribute of the referred-to object in the display.

What is the best design to achieve this?  The following ZPT code
works, but I highly doubt it is the best design :-)
  <td tal:content="python:here.restrictedTraverse(employee.department).title" />

Would it be best to write a python script that iterates over the
actual objects creating a "mirror" object for each that contains the
attributes to be displayed (without the intermediate references) and
let the ZPT handle only the mirror objects?

TIA,
-D

-- 
If we claim to be without sin, we deceive ourselves and the truth is not
in us.
        I John 1:8
 
http://dman13.dyndns.org/~dman/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 240 bytes
Desc: not available
Url : http://lists.zope.org/pipermail/zope/attachments/20030812/db9f1d38/attachment.bin


More information about the Zope mailing list