[Zope] meta_type in DTML returns incorrect type

Dario Alcocer alcocer at helixdigital.com
Thu Jan 1 16:47:47 EST 2004


I'm working with the AddressBook example from the book, "Zope Bible". 
The example uses the following to conditionally display an edit link for 
  an AddressBook entry in the object's index_html (rendered via a 
DTMLFile() object):

<dtml-if "meta_type=='AddressBook Entry'"> | <a 
href="./editEntryForm">Edit Entry</a></dtml-if>

However, this never renders an "Edit Entry" link because meta_type's 
value is 'AddressBook' (i.e. the type of the containing object) and not 
the expected value 'AddressBook Entry'.  I've verified this by printing 
out the type of self.meta_type.

How do I force the object's type to be referenced by the DTMLFile 
object?  In case it matters, I'm using Zope 2.6.1 and Python 2.1 on 
OpenBSD 3.3.  I've tried to invoke the Python debugger, but the ZODB 
can't even find the object in question.





More information about the Zope mailing list