[Zope] dtml-with in a pythonMethod?

Darran Edmundson Darran.Edmundson@anu.edu.au
Fri, 24 Mar 2000 10:39:24 +1100


I have a container ZClass Person.  Person has a (string) property
CurrentPosition which gives the id of a ZClass instance contained
in Person.  Example:

   DarranEdmundson (Person)
       bsc_degree (Degree)
       phd_degree (Degree)
       fellow     (Academic)
       fujitsu    (employment)
       vizlab     (employment)

where DarranEdmundson.CurrentPosition = "vizlab"


I am having problems accessing the CurrentPosition object
in a pythonMethod.

list = []
for person in self.objectValues('Person'):
     position = _.getitem(person.CurrentPosition)
     list.append(person.LastName, position.anyProperty))


I can do it in DTML via

<dtml-in "objectValues('Person')">
<dtml-with "_.getitem(CurrentPosition)">
   <dtml-var LastName> <dtml-var anyProperty>
</dtml-with>
</dtml-in>

I think the question really comes down to: how does one
achieve <dtml-with name> in a pythonMethod?

Cheers,
Darran.