[Zope] Re: external product writing to a file system ?

Dr. Ross Lazarus rossl@med.usyd.edu.au
Thu, 03 Jun 1999 08:41:20 +1000


Thanks for the suggestion, but I'd already looked through the DTMLtest
code and tried that - here's what I got

Sorry, an error occurred.<p>
<PRE>
Traceback (innermost last):
  File lib/python/ZPublisher/Publish.py, line 877, in publish_module
  File lib/python/ZPublisher/Publish.py, line 592, in publish
    (Info: /CDT/cdt/testpub)
  File lib/python/ZPublisher/Response.py, line 264, in setBody
  File lib/python/DocumentTemplate/DT_HTML.py, line 217, in __str__
    (Object: &lt;string&gt;)
  File lib/python/DocumentTemplate/DT_HTML.py, line 211, in quotedHTML
    (Object: &lt;string&gt;)
TypeError: argument 1: expected read-only buffer,
ExplicitAcquirerWrapper found

There must be some function which knows how to deal with the wrapper
which dtml objects have when I grab them from self.objectItems('DTML
Document'). Explicitly unwrapping them with str(foo) doesn't help much -
I just get a quoted html representation.

I'm still missing something here !

Kent Polk wrote:
> 
> In zope.misc, you wrote:
> >One of us is probably really missing something here.
> 
> >The problem I'm wrestling with is the opposite - I can grab zope
> > dtml objects in external methods, but I can't figure out how to
> > call some mythical function render(foo) the way zope does - converting
> > all the zope bits (such as <!--#var bar-->) into the same html that
> > the zope ORB would. Any advice appreciated...
> 
> Maybe I'm still misunderstanding, but you can use Globals.HTML()
> to render a dtml 'string'. Take a look at DocumentTemplate/DTtest.py
> 
> Kent

-- 

Dr Ross Lazarus
Associate Professor and Sub-Dean for Information Technology
Faculty of Medicine, A27, R126a, University of Sydney,
Camperdown, NSW 2006, Australia
Tel: (+61 2) 93514429 Mobile: +61414872482
Fax: (+61 2) 93516646 Email: rossl@med.usyd.edu.au
http://www.health.usyd.edu.au/people/rossl.htm