[Zope-dev] Acquisition in a DTML Tag
Brett Carter
brett@kavi.com
06 Sep 2000 16:41:17 -0700
>>>>> "Brett" == Brett Carter <brett@kavi.com> writes:
Brett> I've defined my own dtml tag (i.e. <dtml-foo></dtml-foo>)
Brett> and I am trying to look up an object depending on the
Brett> arguments passed to my tag. The python class that defines
Brett> the tag inherits from Acquisition.Implicit, but 'self'
Brett> doesn't contain any of the Acquisition hiarchy. It seems
Brett> like this must be possible, since the <dtml-var> tag must
Brett> have to do an object lookup somewhere for objects passed to
Brett> it to render. Can anybody shed some light on this? Is it
Brett> doable? TIA -Brett
Ok, So after some *major* hacking, i've realized that the 'md' passed
into the render() method of my dtml tag contains the namespace, and is
of type 'TemplateDict' which appears to contain a stack of
'MultiMapping's. Weird. Well, anyways, I just used the 'has_key' and
'getitem' methods to lookup my item. The question now is how do I
create a new object in the current namespace? It looks like the
TemplateDict is a read-only type of data structure. Anybody? TIA
-Brett