Commit 1ccb50ad authored by Michel Pelletier's avatar Michel Pelletier

Fixed attribute error bug

parent e7da680a
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""Simple column indices""" """Simple column indices"""
__version__='$Revision: 1.3 $'[11:-2] __version__='$Revision: 1.4 $'[11:-2]
from Globals import Persistent from Globals import Persistent
import BTree import BTree
...@@ -156,10 +156,13 @@ class UnIndex(Persistent): ...@@ -156,10 +156,13 @@ class UnIndex(Persistent):
unindex = self._unindex unindex = self._unindex
id = self.id id = self.id
k=getattr(obj, id)
if callable(k): try:
k = k() k=getattr(obj, id)
if callable(k):
k = k()
except:
k = MV
if k is None or k == MV: if k is None or k == MV:
return return
......
...@@ -202,7 +202,7 @@ Notes on a new text index design ...@@ -202,7 +202,7 @@ Notes on a new text index design
space. space.
""" """
__version__='$Revision: 1.4 $'[11:-2] __version__='$Revision: 1.5 $'[11:-2]
from Globals import Persistent from Globals import Persistent
import BTree, IIBTree, IOBTree import BTree, IIBTree, IOBTree
...@@ -287,12 +287,15 @@ class UnTextIndex(Persistent): ...@@ -287,12 +287,15 @@ class UnTextIndex(Persistent):
id = self.id id = self.id
k = getattr(obj, id) try:
if callable(k): k = getattr(obj, id)
k = str(k()) if callable(k):
else: k = str(k())
k = str(k) else:
k = str(k)
except:
return
d = {} d = {}
old = d.has_key old = d.has_key
last = None last = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment