Re: [Zope-dev] patch for &dtml-foo:bar:baz;
This may, or may not, break the alternate syntax patch/download @ http://www.zope.org/Members/Coventry/dtml_shortcut I'll investigate and find out, and release a new dtml_shortcut if needbe. (I specifically used a colon since it is valid xml) What about using a colon as the separator, but explicitly give the tag the name dtml-root? <dtml-root foo:bar:childofbar> having a whole tag of type ':' seems weird (in addition to possibly breaking current patches and such ;) if we didn't want the root to be the default we could use something like <dtml-trans [path]:[path]> with something like _root or __root being set aside as a special name for starting at the root (otherwise it would start in the current directory)...?
This patch changes lib/python/DocumentTemplate/DT_HTML.py so that you can use paths for traversal in DTML entity syntax. The delimiter is ':', as it is valid as part of an XML entity, but not valid as part of a Zope object id.
You can use &dtml-:foo:bar; to ensure that traversal occurs from the root object. This patch is against Zope 2.2.1b1. It relies on the restrictedTraverse() api. A 2.1.x version would be possible, but would be rather messy. <<<
Hi, I'm trying to replace a manage_x method with a object instanciated (x) in the class fo the object being managed. That seems to work alright but the management tabs get when x is called. What I realy want is a way to get the REQUEST as if the last traversal was never occured. (unfortunatly it's not in my reach because it's done in the parent of the "my_published_object" object). It needs to be reverted one step maybe before calling self.aq_parent.manage_tabs (basicly its the only place I need it att this point). Also are there any potential pitfall's in doing that I'm doing? Best Regards, Johan Carlsson class my_manage_class(...): """doc sting""" _isBeingUsedAsAMethod_=1 # this doesn't work the way I hope it would :-( _isBeingUsedAsAMethod # what's the differense between the two? index_html = HTMLFile(some default DTML calling manage_tabs) def manage_tabs(self): # doesn't realy change the REQUEST context, coold that be done? return self.aq_parent.manage_tabs(self.aq_parent,self.REQUEST) class my_published_object(...): """doc sting""" manage_main = my_manage_class() manage_options=(this is the options i also want to use in manage_main)
participants (2)
-
Johan Carlsson -
Jon Franz