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
b4f9935b
Commit
b4f9935b
authored
Jan 17, 2000
by
Michel Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed raise of abstend id bug
parent
ec2da131
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
7 deletions
+15
-7
lib/python/Products/ZCatalog/Catalog.py
lib/python/Products/ZCatalog/Catalog.py
+15
-7
No files found.
lib/python/Products/ZCatalog/Catalog.py
View file @
b4f9935b
...
...
@@ -85,6 +85,7 @@
from
Persistence
import
Persistent
import
Acquisition
import
ExtensionClass
import
BTree
,
OIBTree
,
IOBTree
,
IIBTree
IIBucket
=
IIBTree
.
Bucket
from
intSet
import
intSet
...
...
@@ -126,7 +127,7 @@ def orify(seq,
return
apply
(
Query
.
Or
,
tuple
(
subqueries
))
class
Catalog
(
Persistent
,
Acquisition
.
Implicit
):
class
Catalog
(
Persistent
,
Acquisition
.
Implicit
,
ExtensionClass
.
Base
):
""" An Object Catalog
An Object Catalog maintains a table of object metadata, and a
...
...
@@ -141,7 +142,7 @@ class Catalog(Persistent, Acquisition.Implicit):
_v_brains
=
NoBrainer
_v_result_class
=
NoBrainer
def
__init__
(
self
,
brains
=
None
):
def
__init__
(
self
,
vocabulary
=
None
,
brains
=
None
):
self
.
schema
=
{}
# mapping from attribute name to column number
self
.
names
=
()
# sequence of column names
...
...
@@ -163,6 +164,11 @@ class Catalog(Persistent, Acquisition.Implicit):
# indexes can share a lexicon or have a private copy. Here,
# we instantiate a lexicon to be shared by all text indexes.
# This may change.
if
type
(
vocabulary
)
is
type
(
''
):
self
.
lexicon
=
vocabulary
else
:
#ack!
self
.
lexicon
=
Lexicon
()
if
brains
is
not
None
:
...
...
@@ -352,6 +358,10 @@ class Catalog(Persistent, Acquisition.Implicit):
total
=
0
for
x
in
self
.
indexes
.
values
():
## tricky! indexes need to acquire now, and because they
## are in a standard dict __getattr__ isn't used, so
## acquisition doesn't kick in, we must explicitly wrap!
x
=
x
.
__of__
(
self
)
if
hasattr
(
x
,
'index_object'
):
blah
=
x
.
index_object
(
i
,
object
,
threshold
)
total
=
total
+
blah
...
...
@@ -369,12 +379,10 @@ class Catalog(Persistent, Acquisition.Implicit):
catalogued, otherwise it will not get removed from the catalog
"""
if
uid
not
in
self
.
uids
.
keys
():
raise
ValueError
,
"Uncatalog of absent id %s"
%
`uid`
rid
=
self
.
uids
[
uid
]
for
x
in
self
.
indexes
.
values
():
x
=
x
.
__of__
(
self
)
if
hasattr
(
x
,
'unindex_object'
):
try
:
x
.
unindex_object
(
rid
)
...
...
@@ -452,7 +460,7 @@ class Catalog(Persistent, Acquisition.Implicit):
if
used
is
None
:
used
=
{}
for
i
in
self
.
indexes
.
keys
():
try
:
index
=
self
.
indexes
[
i
]
index
=
self
.
indexes
[
i
]
.
__of__
(
self
)
if
hasattr
(
index
,
'_apply_index'
):
r
=
index
.
_apply_index
(
args
)
if
r
is
not
None
:
...
...
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