[Zope] Object reference in Zope???

Kam Cheung zope@littlecircle.com
Mon, 12 Jul 1999 21:45:12 -0400


Thanks for everyone who has helped me on this problem. It turned out that 
there is something wrong with my permission setting.

However, I am still not very clear what is the best way to refer to a
subfolder object in Zope.

Here is what I find out so far:

Let's say I have a site like this

Home
index_html
testing
data
testing

1) Problem One
When I am in index_html, I can refer to Home.testing by doing:
<!--#var testing-->

But if I want to display Home.data.testing in index_html,
I have to do:
<!--#var "data.testing"-->

NOTE: <!--#var data.testing-->, without the double quote,
doesn't cut it. Also, if I want to see Home.testing's
title, I have to do <!--#var "testing.title"-->, not
<!--#var testing.title-->


Question: What's the reason behind this inconsistency of reference?
Given the excellent work the Zope team has shown in the
product, I am sure that there must be a reason, right?


2) Problem Two
Let's say in index_html, I have a string property called "pageID", and
"pageID" equals to the string "testing".

Now, if I want to use the "pageID" to refer to the two "testing"
documents, I thought I can do:

<!--#var [pageID]-->
or
<!--#var "data[pageID]"-->

But they don't work. What I end up doing is:
<!--#var "_.getitem(pageID, 1)"-->

That work. The problem is, how can I get "Home.data.testing"?
<!--#var "_.getitem(data[pageID], 1)"--> surely won't work,

but I am surprised that even if I spell out the full path, it still
wouldn't work:
<!--#var "_.getitem('data.testing', 1)"-->
nor does
<!--#var "_.getitem(data.testing, 1)"-->

What I end up doing is:
<!--#with data-->
<!--#var "_.getitem(pageID, 1)"-->
<!--#/with-->


Question: What is the preferred to do that? Is there a better method?
Why can't I simply refer to an object inside "_.getitem" using
a format like "xxx.yyy"?



Sorry for asking these stupid questions, I am really new on programming, and
on Zope. My background is in design, I have never thought of learning
programming when I was in college!!



Kam Cheung