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
d03616e0
Commit
d03616e0
authored
Jan 31, 2000
by
Michel Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partial searching
parent
d0ef2ffc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
lib/python/Products/ZCatalog/Catalog.py
lib/python/Products/ZCatalog/Catalog.py
+15
-4
No files found.
lib/python/Products/ZCatalog/Catalog.py
View file @
d03616e0
...
...
@@ -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,7 +164,12 @@ 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.
self
.
lexicon
=
Lexicon
()
if
type
(
vocabulary
)
is
type
(
''
):
self
.
lexicon
=
vocabulary
else
:
#ack!
self
.
lexicon
=
Lexicon
()
if
brains
is
not
None
:
self
.
_v_brains
=
brains
...
...
@@ -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
...
...
@@ -373,6 +383,7 @@ class Catalog(Persistent, Acquisition.Implicit):
rid
=
self
.
uids
[
uid
]
for
x
in
self
.
indexes
.
values
():
x
=
x
.
__of__
(
self
)
if
hasattr
(
x
,
'unindex_object'
):
try
:
x
.
unindex_object
(
rid
)
...
...
@@ -453,7 +464,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