Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
c0fa62a1
Commit
c0fa62a1
authored
Nov 04, 2003
by
Andreas Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed potential upgrade problem due to new '_length' attribute
parent
4e7522a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
+10
-7
No files found.
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
View file @
c0fa62a1
...
...
@@ -11,7 +11,7 @@
#
##############################################################################
__version__
=
'$Id: PathIndex.py,v 1.3
6 2003/08/16 16:44:42
andreasjung Exp $'
__version__
=
'$Id: PathIndex.py,v 1.3
7 2003/11/04 15:47:35
andreasjung Exp $'
import
warnings
from
types
import
StringType
,
ListType
,
TupleType
...
...
@@ -113,6 +113,7 @@ class PathIndex(Persistent, SimpleItem):
comps
=
filter
(
None
,
path
.
split
(
'/'
))
if
not
self
.
_unindex
.
has_key
(
docid
):
self
.
_
.
migrate_length
()
self
.
_length
.
change
(
1
)
for
i
in
range
(
len
(
comps
)):
...
...
@@ -147,6 +148,7 @@ class PathIndex(Persistent, SimpleItem):
'Attempt to unindex document'
' with id %s failed'
%
docid
)
self
.
_
.
migrate_length
()
self
.
_length
.
change
(
-
1
)
del
self
.
_unindex
[
docid
]
...
...
@@ -201,12 +203,13 @@ class PathIndex(Persistent, SimpleItem):
def
numObjects
(
self
):
""" return the number of indexed objects"""
try
:
return
self
.
_length
()
except
AttributeError
:
# backward compatibility
l
=
len
(
self
.
_unindex
)
self
.
_length
=
Length
(
l
)
return
l
self
.
_migrate_length
()
return
self
.
_length
def
_migrate_length
(
self
):
""" migrate index to use new _length attribute """
if
not
hasattr
(
self
,
'_length'
):
self
.
_length
=
Length
(
len
(
self
.
_unindex
))
def
_apply_index
(
self
,
request
,
cid
=
''
):
""" hook for (Z)Catalog
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment