[Zope] Is this it?

Andrew Kenneth Milton akm@theinternet.com.au
Mon, 1 Oct 2001 18:35:32 +1000


+-------[ tom smith ]----------------------
| I recently asked how to call a ZSQL method in a folder higher up the
| hierarchy.  I can do it if I manually get the parent. This can't be right
| can it?

Nope, although, the reason it works with your parent is that your
parent has an acquisition wrapper. What you want to do is get your
own wrapper to play with...

| Surely, there's a way to do it using acquisition so that it would
| recursively look higher up the folder structure to find the ZSQL method?

Yes there is... 

self = context.this()

results=self.test_sql()
t = ''
for n in results:
    t = t + n.project_name  + '\n'
return t


-- 
Totally Holistic Enterprises Internet|                      | Andrew Milton
The Internet (Aust) Pty Ltd          |                      |
ACN: 082 081 472 ABN: 83 082 081 472 |  M:+61 416 022 411   | Carpe Daemon
PO Box 837 Indooroopilly QLD 4068    |akm@theinternet.com.au|