[Zope] Access to DTML Document properties

Wiebe Kunst Wiebe Kunst" <wkunst@eunet.no
Thu, 11 Mar 1999 15:09:22 +0100


OK - I think I get it, but how do I "convert" a string to a reference to an
object, so that I can call properties associated with the object (DTML
document). This should be possible, isn't it???

Best regards Wiebe Kunst




>At 01:45 AM 3/10/99 -0300, Luciano Ramalho wrote:
>
>><!--#var expr="_['sub-document'].author"-->
>>
>>I wrote this, and it worked fine:
>>
>><!--#var expr="_.getitem('sub-document').author"-->
>>
>>I found a way, but I don't understand why the first syntax worked fine
with
>>Folders and fails with DTML Documents. If anyone would like to clarify the
>>semantic difference between _['sub-document'] and
>>_.getitem('sub-document'), I would be even happier.
>
>The answer is in both the ZDP's FAQ and the DTML Manager's Guide.
>
>_['foo'] "renders" foo according to DTML rules. This process mostly
>consists of calling DTML and other callable objects.
>
>_.getitem('foo') simply returns foo as found in the DTML namespace.
>
>The reason you were having problems is that _['sub-document'] renders the
>document to a string. Naturally strings don't have properties. Hence the
>error you got from Zope, "'string' object has no attribute 'title'".
>
>Make sense?
>
>-Amos
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>http://www.zope.org/mailman/listinfo/zope
>
>(For developer-specific issues, use the companion list,
>zope-dev@zope.org - http://www.zope.org/mailman/listinfo/zope-dev )
>