[Zope] Namespace within a product... (argh...)

Pierre-Julien Grizel grizel@mouli.net
Tue, 10 Oct 2000 11:56:11 +0200


Well, beeing very straightforward, I read this, in
OSFP/Help/DTMLDocument.py :


"""
        A DTMLDocument implicitly pass itself as a client argument in
        addition to the specified client, so names are looked up in
        the DTMLDocument itself.

        Passing in a namespace to a DTML Document is often referred to
        as providing the Document with a *context*.

        DTML Documents are called three ways:

          From DTML -- A DTML Document can be called from another DTML
            Method or Document::

              <dtml-var standard_html_header>
                <dtml-var aDTMLDocument>
              <dtml-var standard_html_footer>

            In this example, the Document 'aDTMLDocument' is being
called
            from another DTML object by name.  The calling method
            passes the value 'this' as the client argument and the
            current DTML names pace as the REQUEST argument.  The above
            is identical to this following usage in a DTML Python
            expression::

              <dtml-var standard_html_header>
                <dtml-var "aDTMLDocument(_.None, _)">
              <dtml-var standard_html_footer>

          From Python -- Products, External Methods, and PythonMethods 
            can call a DTML Document in the same way as calling a DTML
            Document from a Python expression in DTML; as shown in the
            previous example.

          By the Publisher -- When the URL of a DTML Document is fetched 
            from Zope, the DTML Document is called by the publisher.
            The REQUEST object is passes as the second argument to the 
            Document.  
"""

So - I had a look at DTMLDocument.py and saw the following method :

def __call__ (self, client = None, REQUEST = {}, **kw):
	...

SO - I try to create this method for my product :

def __call__ (self, client = None, REQUEST = {}, **kw):
	print client
	print REQUEST


and it prints :
None
{}


It seems that in fact the DTML document doesn't actually pass _.None and
_ to my object. WHY ??????

How can I enforce DTML Docs/Meths to pass it anyway ???



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