[Zope] Renderable Base ZClass

Brian Lloyd Brian@digicool.com
Tue, 2 Nov 1999 16:07:27 -0500


> This solves the REQUEST problem,  but an error then occurs 
> with the DTML
> <!--#in object--> tag, which is the next tag down in the DTML method.
> 
> How can I enable DTML tag parsing, for "in", "with", and 
> other tags tags?
> Is it just a matter of passing the right arguments?
> 
> The script and the error traceback are included below.
> 
> Cheers
> Kevin
> 
> 
> SCRIPT
> --------------------------------------
> import Acquisition
> 
> class Renderable:
> def __str__(self):
>    theRequest=self.REQUEST
>           if theRequest:
>            theObject = getattr(self, 'render')
>            return theObject(theRequest)
>           else:
>            return "no request"


I believe you just need to tweak the way that you are calling
theObject - I'm assuming its a DTML method/document. try:

def __str__(self):
  theRequest=self.REQUEST
  if theRequest:
    theObject = getattr(self, 'render')
    # When calling a dtml method/document, you pass the
    # 'client' of the method, followed by a mapping of
    # values (usually the REQUEST)...
    return theObject(self, theRequest)
  else:
    return "no request"


Let me know if this fixes it.


Brian Lloyd        brian@digicool.com
Software Engineer  540.371.6909              
Digital Creations  http://www.digicool.com