[Zope] Not able to render a base class...

Brian Withun brianw@hilgraeve.com
Fri, 8 Sep 2000 11:14:08 -0400


| -----Original Message-----
| From: ender@earthlink.net [mailto:ender@earthlink.net]On Behalf Of Kapil
| Thangavelu
| Sent: Tuesday, September 05, 2000 12:11 PM
| To: Brian Withun
| Cc: Zope mailing list
| Subject: Re: [Zope] Not able to render a base class...
|
|
| Brian Withun wrote:
| >
| > ===== :PREFACE: =====
| >
| > I have placed the __init.py__ and Renderable.py into
| > .\lib\python\Products\Renderable and have restarted Zope
| (necessary?  ..I'm
| > too used to windows ;-)
| >
| > I made a trivial little Folderish ZClass and am trying to get
| it to render
| > itself...
| >
| > I've defined a 'view' tab that represents the ZClass, and it works as
| > expected, with 'View' being bound to an 'index_html' method of
| my folderish
| > ZClass.
| >
| > I've added one of these ZClasses to a development folder.
| >
| > The development folder also contains a dtml document named
| 'index_html' as
| > follows:
| >
| > <dtml-var standard_html_header>
| > <h2><dtml-var title_or_id></h2>
| > <p>
| > This is the <dtml-var id> Document.
| > </p>
| > <dtml-var one>
| > <dtml-var standard_html_footer>
| >
| > 'test' is my product
| > 'testclass' is my ZClass (in the product 'test')
| > 'trial' is my development folder
| > 'one' is the ZClass instance in the 'trial' folder
| > 'Tropical' is an image id in the ZClass
| >
| > ===== :PROBLEM: =====
| >
| > Why does 'trial/index_html' render this:
| >
| > <html><head></head>
| > <body>
| > <h2>index_html</h2>
| > <p>
| > This is the index_html Document.
| > </p>
| > <testclass instance at 00DD45A8>
| > </body></html>
| >
| > ..and how do I turn '<testclass instance at 00DD45A8>' into a
| rendering of
| > the ZClass instance ?
|
|
| Make sure your zclass inherits from Renderable
| make a dtml method called render in your zclass
| adjust render to display the zclass as you wish
|
|
| Kapil
|

Okay, I can make these changes, but when you say 'Make sure your zclass
inherits from Renderable,' how do I do that?

Should I see 'Renderable' as one of the BASE CLASSES available when I am
creating a zclass, or can I somehow modify an existing zclass to
all-of-a-sudden inherit from Renderable (and how would one do that??)

I was rather expecting to see 'Renderable' as an option in the BASE CLASSES,
but it's not there.  If it's supposed to be there, can you fathom what I may
have done wrong?

------------
Brian Withun