[Zope] Still need help about Product namespace
Hi, I still need help about my product needing to know its namespace... Look at the following piece of DTML Meth/Doc : Right. MyProduct is my product's instance, defining the following method : def __call__ (self, REQUEST=None): if REQUEST is None: if kw: REQUEST=kw else: if hasattr(self, 'REQUEST'): REQUEST=self.REQUEST else: REQUEST={} print STRING This raises a key error. I MUST get the STRING variable from the '_' namespace, but how can I pass IMPLICITLY this namespace to my product ??? Is there a way to acquire _ ??? Many thanks, P.-J. -- If the only tool you have is a hammer, you tend to see every problem as a nail. Si le seul outil dont vous disposez est un marteau, vous avez tendance à voir chaque problème comme un clou. --Abraham Maslow ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Still need help about Product namespace
On Tue, 10 Oct 2000 10:51:09 +0200, Pierre-Julien Grizel <[EMAIL PROTECTED]> wrote: >I still need help about my product needing to know its namespace... You also need to read the answers already provided. http://www.zope.org/Members/htrd/howto/FunctionTemplate Toby Dickenson [EMAIL PROTECTED] ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Still need help about Product namespace
Toby Dickenson wrote: > > On Tue, 10 Oct 2000 10:51:09 +0200, Pierre-Julien Grizel > <[EMAIL PROTECTED]> wrote: > > >I still need help about my product needing to know its namespace... > > You also need to read the answers already provided. > > http://www.zope.org/Members/htrd/howto/FunctionTemplate > I saw your answer and I did downloaded your program... But it still doesn't work, the dtml-let statement doesn't have any effect on the namespace the TemplateClass instance fetches. But maybe is there a different way to 'call' my product, than doing a ? I double-checked that you had the same problem as me : when doing a dtml-var on a TemplateClass instance, neither client nor context are passed... Anyway, many thanks for your work, it has been useful for me understanding the TemplateDict mechanism. P.-J. -- If the only tool you have is a hammer, you tend to see every problem as a nail. Si le seul outil dont vous disposez est un marteau, vous avez tendance à voir chaque problème comme un clou. --Abraham Maslow ___ Zope maillist - [EMAIL PROTECTED] 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 )