Andrew Milton schrieb:
> Perhaps if you describe the problem you're trying to solve, we can actually
> help you.

Yes, thank you!

I just want to be able to do what I'm used to do from TTW:

- There is a hirarchy of Folder/File objects
- In the root directory there is an python script (
- the python script operates on context eg.


>From a ZPT I can now loop over a Folder and call the python script on every 
>object in the folder:

 <li tal:repeat="elem context/objectValues"

Depending on the URL I call this on I will get a list of data of all files 
present here.

This is just what I want to do in the fs product I'm writing:

I have a folderish object that holds a collection of File objects nicely sorted 
in a hirarchy of Folders objects.
This folderish object has methods to display the data in the File objects 
(underneth it self) in differnt ways eg.

def genGraph(self):
    "plot graph from and return a png image"

def getDataMatrix(self):
    "return as a list of rows where every field is a list element"

just as in my example above I want to be able to call this methods on any File 
objects from a ZPT like this:

 <li tal:repeat="elem context/objectValues"
  <img tal:attributes="src string: ${elem/absolute_url}/genGraph"> plot </img>

Therefore I started the thread:
[Zope] context in fs product

The answer I got:

'self' inside the a Zope product is the _same_ as 'context' or 'here' within
ZPT or PythonScripts.

So now I'm stuck.

Of course I could pass the object or its id to the methods as an argument eg.

<span tal:define="data python:context.genGraphs(elem)">sdf</span>

and in the method get the the object with getattr() or something ...

But this wouldn't be nearly as nice and I'd like to avoid this.

(The code examples here might have errors, I just typed them in as an 
illustration of my thougts)

Greetings Roman

Zope maillist  -
**   No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to