Passing mapping argument to DTML Method
Hi: I'm a bit frustrated trying to pass dictionaries to DTML Methods, I need to pass a dictionary with a lot of pairs key, value to be rendered in a DTML Document. I do something like: monitor_html = DTMLFile('dtml/onemonitor',globals()) ... return self.monitor_html(None,...) But how I can simply pass this dictionary to the namespace of this DTML Document? Adding it to the request? -- Microsoft merges technologoies: Windows CE + Windows ME + Windows NT = Windows CEMENT ---- Antonio Beamud Montero Agora Systems S.A. http://www.agoratechnologies.com
Hi again: I reply myself, I have resolved the problem with: REQUEST.other.update(midicc) return self.mydtmlmethod(REQUEST=REQUEST) Is this the correct form? Thanks El jue, 26-09-2002 a las 16:18, Antonio Beamud Montero escribió:
Hi: I'm a bit frustrated trying to pass dictionaries to DTML Methods, I need to pass a dictionary with a lot of pairs key, value to be rendered in a DTML Document. I do something like:
monitor_html = DTMLFile('dtml/onemonitor',globals()) ... return self.monitor_html(None,...)
But how I can simply pass this dictionary to the namespace of this DTML Document? Adding it to the request? -- Microsoft merges technologoies: Windows CE + Windows ME + Windows NT = Windows CEMENT
---- Antonio Beamud Montero Agora Systems S.A.
http://www.agoratechnologies.com
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev ) -- Microsoft merges technologoies: Windows CE + Windows ME + Windows NT = Windows CEMENT
---- Antonio Beamud Montero Agora Systems S.A. http://www.agoratechnologies.com
Antonio Beamud Montero wrote:
I'm a bit frustrated trying to pass dictionaries to DTML Methods, I need to pass a dictionary with a lot of pairs key, value to be rendered in a DTML Document. I do something like:
monitor_html = DTMLFile('dtml/onemonitor',globals()) ... return self.monitor_html(None,...)
But how I can simply pass this dictionary to the namespace of this DTML Document? Adding it to the request?
You can safely do it like: return self.monitor_html(self, self.REQUEST, **yourdict) dtml will take the values from yourdict before the values in request and self. You can also do it like: return self.monitor_html(None, {}, **yourdict) But then you *only* pass the values from yourdict perhaps it's even feasible to: return self.monitor_html(**yourdict) But that can be a bit fishy. Especially if your dict by chance has the keys "client" or "mapping" regards Max M --- The reason I don't reach any higher is that I stand on the shoulders of midgets.
participants (2)
-
Antonio Beamud Montero -
Max M