[Zope] ZTopic error

Tres Seaver tseaver@digicool.com
Thu, 18 Jan 2001 07:30:16 -0500


"Priya Ramkumar" <pra@baba9.com> wrote:

> I am trying to use ZTopic for categorizing obejcts in a Zcatalog. After
> specifying the criteria, when I try to view the list of topics, it gives me
> the traceback error:
> 
> Error Type: AttributeError
> Error Value: Vocabulary
> 
> Is there any bug fix for this?

ZTopic is slightly out of date;  in particular, it uses the (text)
indices without wrapping them in their catalog, so they can't
acquire their vocabulary object.

The patch is a simple one-liner:

$ diff -bu Topic.py.org Topic.p >
--- Topic.py.org	Wed Nov  3 16:25:15 1999
+++ Topic.py	Thu Nov 30 21:27:48 2000
@@ -224,7 +224,7 @@
             c=zcatalog._catalog
             for search_term in search_map.keys():
                 if c.indexes.has_key(search_term):
-                    index=c.indexes[search_term]
+                    index=c.indexes[search_term].__of__(c)
                     search_results=index._apply_index(search_map)
                     if search_results is not None:

Tres.
-- 
===============================================================
Tres Seaver                                tseaver@digicool.com
Digital Creations     "Zope Dealers"       http://www.zope.org