[Zope-Checkins] CVS: Zope2 - Catalog.py:1.60.2.6

Jim Fulton jim@digicool.com
Sat, 17 Mar 2001 13:01:17 -0500 (EST)


Update of /cvs-repository/Zope2/lib/python/Products/ZCatalog
In directory korak:/tmp/cvs-serv24643

Modified Files:
      Tag: zope-2_3-branch
	Catalog.py 
Log Message:
New catalogs have 'lexicon' attributes that are lexicon named, but
ole catalogs store their lexicons directly. This makes it hard
to manage text indexes correctly. Added some code to assure that
when a text index is added, we always pass the actual lexicon.



--- Updated File Catalog.py in package Zope2 --
--- Catalog.py	2001/03/17 17:28:07	1.60.2.5
+++ Catalog.py	2001/03/17 18:01:16	1.60.2.6
@@ -353,10 +353,9 @@
         if type == 'FieldIndex':
             indexes[name] = UnIndex.UnIndex(name)
         elif type == 'TextIndex':
-            indexes[name] = UnTextIndex.UnTextIndex(
-                name, None, None,
-                getattr(self, self.lexicon), # The index needs to have the lex.
-                )
+            lexicon=self.lexicon
+            if type(lexicon) is type(''): lexicon=getattr(self, lexicon)
+            indexes[name] = UnTextIndex.UnTextIndex(name, None, None, lexicon)
         elif type == 'KeywordIndex':
             indexes[name] = UnKeywordIndex.UnKeywordIndex(name)
         else: