object properties access strangeness
Hi all, I have problem with Zope 2.9.4, where I cannot get properties from acquired DTML Document in same way as from Image (both are in folder above, both objects with properties defined). It seems as to be a permission problem, but I was look through permissions at whole tree up to zope root. This is working: <dtml-with picture.gif> <dtml-var IMGproperty>(existing property at Image) </dtml-with> And this raise error: <dtml-with dtml_document_file> <dtml-var ikona1>(existing property at DTML document) </dtml-with> Error: Error Type: KeyError Error Value: 'ikona1' ------ Module DocumentTemplate.DT_String, line 476, in __call__ Module DocumentTemplate.DT_With, line 76, in render Module DocumentTemplate.DT_Util, line 196, in eval - __traceback_info__: _ Module <string>, line 1, in <expression> Module AccessControl.ZopeGuards, line 67, in guarded_getitem KeyError: 'ikona1' I was try to isolate problem in my "sandbox" with slightly different error, but still does not able to get properties from acqiured DTML Document object: Module DocumentTemplate.DT_String, line 476, in __call__ Module DocumentTemplate.DT_With, line 76, in render KeyError: 'ikona1'
----- Original Message ----- From: "Jaroslav Lukesh" <lukesh@seznam.cz> To: <zope@zope.org> Sent: Thursday, October 25, 2007 12:38 PM Subject: [Zope] object properties access strangeness
Hi all,
I have problem with Zope 2.9.4, where I cannot get properties from acquired DTML Document in same way as from Image (both are in folder above, both objects with properties defined). It seems as to be a permission problem, but I was look through permissions at whole tree up to zope root.
This is working:
<dtml-with picture.gif> <dtml-var IMGproperty>(existing property at Image) </dtml-with>
And this raise error:
<dtml-with dtml_document_file> <dtml-var ikona1>(existing property at DTML document) </dtml-with>
Error:
Error Type: KeyError Error Value: 'ikona1'
Try: <dtml-var "dtml_document_file.getProperty('ikona1', 'badPropertyName')"> Lots of good info in the PropertyManager appendix section of the ZopeBook... Jonathan
----- Original Message ----- From: "Jonathan" <dev101@magma.ca>
This is working:
<dtml-with picture.gif> <dtml-var IMGproperty>(existing property at Image) </dtml-with>
And this raise error:
<dtml-with dtml_document_file> <dtml-var ikona1>(existing property at DTML document) </dtml-with>
Try:
<dtml-var "dtml_document_file.getProperty('ikona1', 'badPropertyName')">
Many thanks, it works. Regards, JL. PS: for clarity only, it does not work with each filename - I was test it at file with dot in their name :o) <dtml-var "_['dtml.document.file.name.with.dot'].getProperty('ikona1', None)">
participants (2)
-
Jaroslav Lukesh -
Jonathan