RE: [Zope] How can I examine an property of an object from the ot her object in the other tree?
Please don't send anything but plain text mail to the zope list. It makes it difficult for us to reply because of our mail setup. You wrote:
Now , for an example, I want to know the value of /english/members/info's > TR value from /korean/members/info. info is DTML Document in both case.
The following variations gave me KeyError .
<!--#var "_['english.member.info.TR]' --> <!--#var "_['english.member.info]' --> <!--#var "_[isTRed]' -->
Note that you have two syntax errors per line here. You are missing a closing double quote on your expressions and your single quotes are not nested propery within the square brackets. Also you don't even need to look up these things in the _ namespace since they are all legal python expressions anyway: <!--#var "english.member.info.TR"--> is I think what you meant. Also, experiment with 'with': <!--#with english--> <!--#if "member.info.TR"--> Translated <!--#else--> Not translated <!--#/if--> <!--#/with--> -Michel
Thank you for your reply with apology for non-plain text mail & varous typos. After a shower and your reply, I can refine my question. As you wrote, <!--#var "english.members.test.docTest.TR"--> works OK. (docTest is DTML Document and TR is its property) But only as far as I *hard code* into every DTML Document such a line(yes there is a way to hard code such a line into every DTML Document if I have to but it seems too foolish and complicated). Is there a way to write *ONE* DTML code and use it in every DTML Document? I wrote in the root folder an one liner DTML method 'isTRed' which is <!--#var "'english.'+ _.string.join( _.string.split(URL0, '/')[4:], '.')+'.TR'" --> It gives the string english.members.test.docTest.TR when called in the DTML Document /korean/members/test/docTest as <!--#var isTRed-->. But <!--#var "isTRed" --> gives the source of isTRed method. And <!--#var "_[isTRed]"--> gives attribute error. <!--#var "_['isTRed']"--> gives the string english.members.test.docTest.TR as might be expected. Please don't laugh at my silliness, : (. Any revelation? TIA LEE Kwan Soo.
participants (2)
-
Michel Pelletier -
이관수(LEE Kwan Soo)