Hi,

 

I’m not sure if the subject line accurately describes what I’m trying to do, anyway let me try and explain.

 

I have a set of folders like this:

 

Site root object

      |---- Attributes object

      |---- Layout ZPT

      |---- get_attobject (python script)

      |---- get_attributes (python script)

      |---- Folder object A

                  |-----Attributes object

      |---- Folder object B

 

 

My 'get_attobject' script is called from my 'Layout zpt' using this code:

<div tal:define="attobject here/get_attobject"></div>

 

And my get_attobject script contains the following code:

 

      attobjects = context.objectValues('Attributes object')

      if attobjects:

            return attobjects[0]

      return None

           

Then my get_attributes script uses the attobjects value returned from the get_attobject script to output the values of the 'Attributes object'. Now this all works fine in the 'Site root object' and in 'Folder object A' but when I get to 'Folder object B' there is nothing returned since I have no 'Attributes object' present.

 

But what I'd like to do in this situation is use acquisition to retrieve the values from the parent 'Attributes object' located in the site root. So could someone please explain how I could achieve this?

 

Hope someone can help me, many thanks. If any more information is required please ask.

 

Jon

 

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to