Hi, I'm using the following dtml-with expression and it works perfekt. <dtml-with "aq_parent.aq_parent.edit.Terminhinweisverwaltung"> <dtml-var index_html> </dtml-with> As it can't be static anymore it tried the following. <dtml-call "REQUEST.set('wusch', 'aq_parent.aq_parent.edit.Terminhinweisverwaltung')"> <dtml-with "_[wusch]"> <dtml-var index_html> </dtml-with> But this raises an KeyError. Error Type: KeyError Error Value: aq_parent.aq_parent.edit.Terminhinweisverwaltung If the value of wusch is 'aq_parent' it works, but as soon as there is a dot in it another KeyError is raised. Any ideas what I'm doing wrong? MfG Steffen -- Zu sagen 'Hier herrscht Freiheit' ist immer ein Irrtum oder auch eine Lüge -- Freiheit herrscht nicht (Erich Fried)
Steffen Hausmann wrote:
Hi,
I'm using the following dtml-with expression and it works perfekt.
<dtml-with "aq_parent.aq_parent.edit.Terminhinweisverwaltung"> <dtml-var index_html> </dtml-with>
As it can't be static anymore it tried the following.
<dtml-call "REQUEST.set('wusch', 'aq_parent.aq_parent.edit.Terminhinweisverwaltung')">
<dtml-with "_[wusch]"> <dtml-var index_html> </dtml-with>
But this raises an KeyError.
Error Type: KeyError Error Value: aq_parent.aq_parent.edit.Terminhinweisverwaltung
If the value of wusch is 'aq_parent' it works, but as soon as there is a dot in it another KeyError is raised.
Any ideas what I'm doing wrong?
Yeah, you're either misunderstanding the meaning of _[...], or the meaning of the dot in python expressions. _['string'] tries to find the value of the variable named string in the namespace. The dot is an operator which means basically "lookup". So "a.b.c.d" is a python expression, no variable name, and _[...] can't work. May it might be better to use restrictedTraverse()? Or <dtml-with "aq_parent.aq_parent.edit[wusch]">, where e.g. wusch == 'Terminverwaltung' HTH, oliver
On Sun, Jun 15, 2003 at 08:57:30AM +0200, Oliver Bleutgen wrote:
Steffen Hausmann wrote:
I'm using the following dtml-with expression and it works perfekt.
<dtml-with "aq_parent.aq_parent.edit.Terminhinweisverwaltung"> <dtml-var index_html> </dtml-with>
As it can't be static anymore it tried the following.
<dtml-call "REQUEST.set('wusch', 'aq_parent.aq_parent.edit.Terminhinweisverwaltung')">
<dtml-with "_[wusch]"> <dtml-var index_html> </dtml-with>
But this raises an KeyError.
Error Type: KeyError Error Value: aq_parent.aq_parent.edit.Terminhinweisverwaltung
If the value of wusch is 'aq_parent' it works, but as soon as there is a dot in it another KeyError is raised.
Any ideas what I'm doing wrong?
Yeah, you're either misunderstanding the meaning of _[...], or the meaning of the dot in python expressions. _['string'] tries to find the value of the variable named string in the namespace. The dot is an operator which means basically "lookup". So "a.b.c.d" is a python expression, no variable name, and _[...] can't work. May it might be better to use restrictedTraverse()? Or <dtml-with "aq_parent.aq_parent.edit[wusch]">, where e.g. wusch == 'Terminverwaltung'
Thanks for the hint, I think this is the right direction. <dtml-with "restrictedTraverse('../../edit/')"> works, but if I try to access the whole path (../../edit/Terminhinweisverwaltung/) another error is raised. Error Type: Unauthorized Error Value: You are not allowed to access Terminhinweisverwaltung in this context If I use unrestrictedTraverse it works, but I can't imagine why it doesn't work if security is turned on. Any Ideas? MfG Steffen -- Zu sagen 'Hier herrscht Freiheit' ist immer ein Irrtum oder auch eine Lüge -- Freiheit herrscht nicht (Erich Fried)
Steffen Hausmann wrote:
Thanks for the hint, I think this is the right direction.
<dtml-with "restrictedTraverse('../../edit/')">
I'd use restrictedTraverse('/path/from/root/edit/whatever') here, but that might depend on your setup (i.e. if you plan to change /path/from/root
works, but if I try to access the whole path (../../edit/Terminhinweisverwaltung/) another error is raised.
Error Type: Unauthorized Error Value: You are not allowed to access Terminhinweisverwaltung in this context
If I use unrestrictedTraverse it works, but I can't imagine why it doesn't work if security is turned on.
Any Ideas?
Hmm, only a guess, does the user have the "Access Contents Information" permission everywhere in the path (esp. at 'edit')? But this is clearly fixable by giving the right permissions. HTH, oliver
Does anyone know what this traceback mean. 2003-06-15T14:17:28 INFO(0) Z2 CONFLICT Competing writes at, /Home/FLA SH/getFolderAttr Traceback (innermost last): File C:\WebSite\lib\python\ZPublisher\Publish.py, line 175, in publish File C:\WebSite\lib\python\Zope\__init__.py, line 235, in commit File C:\WebSite\lib\python\ZODB\Transaction.py, line 252, in commit File C:\WebSite\lib\python\ZODB\Connection.py, line 270, in commit ConflictError: '\000\000\000\000\000\000\037^' ------ 2003-06-15T14:17:28 INFO(0) Z2 CONFLICT Competing writes at, /Home/FLA SH/getFolderAttr Traceback (innermost last): File C:\WebSite\lib\python\ZPublisher\Publish.py, line 175, in publish File C:\WebSite\lib\python\Zope\__init__.py, line 235, in commit File C:\WebSite\lib\python\ZODB\Transaction.py, line 252, in commit File C:\WebSite\lib\python\ZODB\Connection.py, line 270, in commit ConflictError: '\000\000\000\000\000\000\037^'
Sven Hohage wrote at 2003-6-15 16:22 +0200:
Does anyone know what this traceback mean.
2003-06-15T14:17:28 INFO(0) Z2 CONFLICT Competing writes at, /Home/FLA
Please search the mailing list archives for "ConflictError". You will find excellent explanations of the problem ;-) Dieter
participants (4)
-
Dieter Maurer -
Oliver Bleutgen -
Steffen Hausmann -
Sven Hohage