On Tue, Oct 10, 2000 at 11:56:11AM +0200, Pierre-Julien Grizel wrote:
> 
> 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 ??????

Evan already answered, but the short story is:

your object needs to have an attribute (it may be a class
attribute and usually is) named "isDocTemp", and this attribute
must evaluate to true. Otherwise, your object is called with no
parameters.

The relevant code is:

        if hasattr(v,'isDocTemp') and v.isDocTemp:
            v=v(None, self)
        else:
            try: v=v()
            except (AttributeError,TypeError): pass

(from DocumentTemplate/DT_Util.py:277)

[]s,
                                               |alo
                                               +----
--
          Hack and Roll  ( http://www.hackandroll.org )
            News for, uh, whatever it is that we are.


http://zope.gf.com.br/lalo           mailto:[EMAIL PROTECTED]
         pgp key: http://zope.gf.com.br/lalo/pessoal/pgp

Brazil of Darkness (RPG)    ---     http://zope.gf.com.br/BroDar

_______________________________________________
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 )

Reply via email to