[Zope] meta_type in DTML returns incorrect type

Dieter Maurer dieter at handshake.de
Fri Jan 2 14:23:38 EST 2004


Dario Alcocer wrote at 2004-1-1 13:47 -0800:
>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.

This means:
 
  either your "index_html" is "applied" to the "AddressBook"
     (and not an entry)

  or an "AddressBook Entry" does not have a "meta_type" attribute.

-- 
Dieter



More information about the Zope mailing list