[Zope] Rendering Product by index_html

Thomas Adams thomas.adams at onlinehome.de
Sat Apr 22 08:17:00 EDT 2006


on an own product (derived from ObjectManager) I try to code a render 
method, therefore I've coded this first

def index_html(self):
    return Globals.DTMLFile('dtml/viewKBArticle',globals())

the result of calling an URLl like this .../MyArticle/index_html
was that the above mentioned DTML-File was completely rendered
as html quoted text like this :

lt;?xml version="1.0" encoding="iso-8859-1"?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
<html xmlns="http://www.w3.org/1999/xhtml">
... etc.

Then I made a search in the mailing list and try this:

myIndex = Globals.DTMLFile('dtml/viewKBArticle',globals())

def index_html(self):
    return self.myIndex(self, self.REQUEST)

this results in :
*Error Type: TypeError*
*Error Value: unsubscriptable object

Traceback (innermost last):
  Module ZPublisher.Publish, line 101, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 39, in call_object
  Module Products.KBProducts.kbarticle_impl, line 440, in index_html
  Module Shared.DC.Scripts.Bindings, line 306, in __call__
  Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec
  Module App.special_dtml, line 175, in _exec
  Module DocumentTemplate.DT_In, line 685, in renderwob
  Module OFS.ObjectManager, line 656, in __getitem__
  Module OFS.ObjectManager, line 241, in _getOb
TypeError: unsubscriptable object

At last I try this:

index_html = None
__call__ = Globals.DTMLFile('dtml/viewKBArticle',globals())

This results also in a TypeError (traceback see above)

Has anyboby any ideas??

Current Zope is 2.7.3, Python 2.3.4 on Windows XP SP2

Thanks in advance

Thomas Adams

-------------- next part --------------
A non-text attachment was scrubbed...
Name: thomas.adams.vcf
Type: text/x-vcard
Size: 334 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20060422/a876bcd1/thomas.adams.vcf

More information about the Zope mailing list