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
d04d18d9
Commit
d04d18d9
authored
Mar 13, 2002
by
Toby Dickenson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
merged toby-catalog-delete-property-branch: Collector 291: deleting and indexed property
parent
eb7fa5ef
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
2 deletions
+40
-2
doc/CHANGES.txt
doc/CHANGES.txt
+2
-0
lib/python/Products/PluginIndexes/FieldIndex/tests/testFieldIndex.py
...Products/PluginIndexes/FieldIndex/tests/testFieldIndex.py
+30
-1
lib/python/Products/PluginIndexes/common/UnIndex.py
lib/python/Products/PluginIndexes/common/UnIndex.py
+8
-1
No files found.
doc/CHANGES.txt
View file @
d04d18d9
...
...
@@ -104,6 +104,8 @@ Zope Changes
- Fixed a bug in TM.py that would cause database adapters to hang
on errors in the second phase of the two-phase commit.
- Collector #291: ZCatalog not unindexing deleted properties
Zope 2.5.1 beta 1
Bugs Fixed
...
...
lib/python/Products/PluginIndexes/FieldIndex/tests/testFieldIndex.py
View file @
d04d18d9
...
...
@@ -148,6 +148,29 @@ class TestCase( unittest.TestCase ):
self
.
_checkApply
(
self
.
_none_req
,
values
[
-
1
:])
assert
None
in
self
.
_index
.
uniqueValues
(
'foo'
)
def
testReindex
(
self
):
self
.
_populateIndex
()
result
,
used
=
self
.
_index
.
_apply_index
(
{
'foo'
:
'abc'
}
)
assert
list
(
result
)
==
[
2
]
assert
self
.
_index
.
keyForDocument
(
2
)
==
'abc'
d
=
Dummy
(
'world'
)
self
.
_index
.
index_object
(
2
,
d
)
result
,
used
=
self
.
_index
.
_apply_index
(
{
'foo'
:
'world'
}
)
assert
list
(
result
)
==
[
2
]
assert
self
.
_index
.
keyForDocument
(
2
)
==
'world'
del
d
.
_foo
self
.
_index
.
index_object
(
2
,
d
)
result
,
used
=
self
.
_index
.
_apply_index
(
{
'foo'
:
'world'
}
)
assert
list
(
result
)
==
[]
try
:
should_not_be
=
self
.
_index
.
keyForDocument
(
2
)
except
KeyError
:
# As expected, we deleted that attribute.
pass
else
:
# before Collector #291 this would be 'world'
raise
ValueError
(
repr
(
should_not_be
))
def
testRange
(
self
):
"""Test a range search"""
index
=
FieldIndex
(
'foo'
)
...
...
@@ -183,3 +206,9 @@ class TestCase( unittest.TestCase ):
def
test_suite
():
return
unittest
.
makeSuite
(
TestCase
)
def
main
():
unittest
.
TextTestRunner
().
run
(
test_suite
())
if
__name__
==
'__main__'
:
main
()
lib/python/Products/PluginIndexes/common/UnIndex.py
View file @
d04d18d9
...
...
@@ -13,7 +13,7 @@
"""Simple column indices"""
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
from
Globals
import
Persistent
from
Acquisition
import
Implicit
...
...
@@ -224,6 +224,13 @@ class UnIndex(Persistent, Implicit):
if
datum
!=
oldDatum
:
if
oldDatum
is
not
_marker
:
self
.
removeForwardIndexEntry
(
oldDatum
,
documentId
)
if
datum
is
_marker
:
try
:
del
self
.
_unindex
[
documentId
]
except
:
LOG
(
'UnIndex'
,
ERROR
,
'Should not happen: oldDatum was there, now its not,'
'for document with id %s'
%
documentId
)
if
datum
is
not
_marker
:
self
.
insertForwardIndexEntry
(
datum
,
documentId
)
...
...
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