[Zope] property to method and back again

Mark James Adams mark@raysend.com
Thu, 4 Apr 2002 14:16:24 -0500


Hello:

I seem to have broken a ZClass that I'm developing. The ZClass 
represents a foreign language video of people speaking different words 
that sound similar. The instructor wanted a way to have the phrase 
associated with the video (which is also the video's title) come up with 
colored markings for the part of the phrase being emphasized in the 
video. For example, one video/phrase is 'vliezig-vlezig', where the 'ie' 
in the first word and the 'e' in the second word are highlighted. I 
wrote some code that, given a marked-up phrase like 'vl$ie$ig-vl$e$ig', 
return a HTML/CSS marked-up version, color-coding the letters between 
the '$'-signs.

However, I still wanted to title to come up without any kind of markup, 
so I moved the marked-up title (with the dollar signs) to a new 
property, and deleted the title property. I then created a Python method 
called 'title' in the ZClass, which would return a non-marked up title.

But now I get "KeyError: title" everytime a try to view the methods in 
the ZClass.

I wrote a script to examine the ZClass, and placed it in the ZClass's 
product's folder:

<dtml-in "MyZClass.propertysheets.methods.objectIds()">
<p><dtml-var sequence-item>
</dtml-in>

This script returns the following:

method1
method2
etc..
title

So the 'title' python script is obviously in the ZClass, but if I try to 
access:

/Control_Panel/Products/MyProduct/MyZClass/propertysheets/methods/title/manage_main

I get, "Site Error: Resource not found".

Any ideas on what the problem is, and how I can correct it?

If worse comes to worse, I'm able to directly access all of the methods 
in my ZClass (except for title), so I can always delete the ZClass and 
then recreate it.

Thanks.

--
Mark James Adams
mark@raysend.com