[Zope] DTML string in Zope Product

Peter Bengtsson mail@peterbe.com
Mon, 14 Oct 2002 23:02:44 +0100


--=======770A72=======
Content-Type: text/plain; x-avg-checked=avg-ok-5D9B2CD4; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 8bit

Don't know if you've got the answer yet but here's the answer:

     def index_html(self, *arg, **kw):
         " Zope __str__  "
         return DTMLFile('index', globals(), mapping=kw).__of__(self)()

This is useful if you wanna make the following modifications:

     def index_html(self, *arg, **kw):
         " Zope __str__  "
         if self.REQUEST.SomeLanguage=='se':
            file = 'index.se'
         else:
            file = 'index.en'
         return DTMLFile(file, globals(), mapping=kw).__of__(self)()




At 15:15 2002-10-09 +0200, Bo M. Maryniuck wrote:

>Hi.
>Somebody know how to do instead:
>
>someFoo = DTMLFile('file', globals())
>
>def someFoo(self, REQUEST = None):
>         """abc"""
>         myDTML = "<standard_html_header>Test!<standard_html_footer>"
>         return myDTML
>
>Yes, I know: I should render it first. But how? I didn't find (yet) any
>DTMLString or something. Any hints?
>
>--
>Regards, Bogdan
>
>Never assume the reader has read the subject line.
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>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 )
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.391 / Virus Database: 222 - Release Date: 2002-09-19

--=======770A72=======
Content-Type: text/plain; charset=us-ascii; x-avg=cert; x-avg-checked=avg-ok-5D9B2CD4
Content-Disposition: inline


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.391 / Virus Database: 222 - Release Date: 2002-09-19

--=======770A72=======--