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
680fb65b
Commit
680fb65b
authored
Dec 05, 2002
by
Casey Duncan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merging pluginindex cleanup into the head
parent
2167f3f6
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
25 deletions
+64
-25
lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
+3
-2
lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
...n/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
+4
-2
lib/python/Products/PluginIndexes/FieldIndex/FieldIndex.py
lib/python/Products/PluginIndexes/FieldIndex/FieldIndex.py
+3
-2
lib/python/Products/PluginIndexes/KeywordIndex/KeywordIndex.py
...ython/Products/PluginIndexes/KeywordIndex/KeywordIndex.py
+2
-1
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
+8
-2
lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py
lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py
+3
-2
lib/python/Products/PluginIndexes/common/PluggableIndex.py
lib/python/Products/PluginIndexes/common/PluggableIndex.py
+33
-10
lib/python/Products/PluginIndexes/common/UnIndex.py
lib/python/Products/PluginIndexes/common/UnIndex.py
+8
-4
No files found.
lib/python/Products/PluginIndexes/DateIndex/DateIndex.py
View file @
680fb65b
...
...
@@ -11,7 +11,7 @@
#
##############################################################################
"""$Id: DateIndex.py,v 1.
8 2002/10/01 14:09:47 gvanrossum
Exp $
"""$Id: DateIndex.py,v 1.
9 2002/12/05 21:35:52 caseman
Exp $
"""
from
DateTime.DateTime
import
DateTime
...
...
@@ -32,7 +32,8 @@ _marker = []
class
DateIndex
(
UnIndex
):
""" Index for Dates """
__implements__
=
(
PluggableIndex
.
PluggableIndexInterface
,)
__implements__
=
(
PluggableIndex
.
UniqueValueIndex
,
PluggableIndex
.
SortIndex
)
meta_type
=
'DateIndex'
query_options
=
[
'query'
,
'range'
]
...
...
lib/python/Products/PluginIndexes/DateRangeIndex/DateRangeIndex.py
View file @
680fb65b
...
...
@@ -11,7 +11,7 @@
#
##############################################################################
"""$Id: DateRangeIndex.py,v 1.
4 2002/08/14 22:19:28 mj
Exp $
"""$Id: DateRangeIndex.py,v 1.
5 2002/12/05 21:35:52 caseman
Exp $
"""
from
Products.PluginIndexes
import
PluggableIndex
...
...
@@ -52,7 +52,9 @@ class DateRangeIndex(UnIndex):
- Objects which match only during a specific interval.
"""
__implements__
=
(
PluggableIndex
.
PluggableIndexInterface
,
)
__implements__
=
(
PluggableIndex
.
UniqueValueIndex
,
PluggableIndex
.
SortIndex
)
security
=
ClassSecurityInfo
()
...
...
lib/python/Products/PluginIndexes/FieldIndex/FieldIndex.py
View file @
680fb65b
...
...
@@ -13,7 +13,7 @@
"""Simple column indices
$Id: FieldIndex.py,v 1.1
0 2002/08/14 22:19:29 mj
Exp $
$Id: FieldIndex.py,v 1.1
1 2002/12/05 21:35:52 caseman
Exp $
"""
from
Products.PluginIndexes
import
PluggableIndex
...
...
@@ -24,7 +24,8 @@ from Globals import DTMLFile
class
FieldIndex
(
UnIndex
):
"""Field Indexes"""
__implements__
=
(
PluggableIndex
.
PluggableIndexInterface
,)
__implements__
=
(
PluggableIndex
.
UniqueValueIndex
,
PluggableIndex
.
SortIndex
)
meta_type
=
"FieldIndex"
...
...
lib/python/Products/PluginIndexes/KeywordIndex/KeywordIndex.py
View file @
680fb65b
...
...
@@ -21,7 +21,8 @@ from Products.PluginIndexes.common.UnIndex import UnIndex
class
KeywordIndex
(
UnIndex
):
__implements__
=
(
PluggableIndex
.
PluggableIndexInterface
,)
__implements__
=
(
PluggableIndex
.
UniqueValueIndex
,
PluggableIndex
.
SortIndex
)
meta_type
=
"KeywordIndex"
...
...
lib/python/Products/PluginIndexes/PathIndex/PathIndex.py
View file @
680fb65b
...
...
@@ -11,7 +11,7 @@
#
##############################################################################
__version__
=
'$Id: PathIndex.py,v 1.
29 2002/11/28 13:03:11 beaco
n Exp $'
__version__
=
'$Id: PathIndex.py,v 1.
30 2002/12/05 21:35:53 casema
n Exp $'
from
Products.PluginIndexes
import
PluggableIndex
from
Products.PluginIndexes.common.util
import
parseIndexRequest
...
...
@@ -44,7 +44,7 @@ class PathIndex(Persistent, Implicit, SimpleItem):
"""
__implements__
=
(
PluggableIndex
.
PluggableIndexInterface
,)
__implements__
=
(
PluggableIndex
.
UniqueValueIndex
,)
meta_type
=
"PathIndex"
...
...
@@ -328,6 +328,12 @@ class PathIndex(Persistent, Implicit, SimpleItem):
else
:
return
IISet
(),
(
self
.
id
,)
def
hasUniqueValuesFor
(
self
,
name
):
"""has unique values for column name"""
if
name
==
self
.
id
:
return
1
else
:
return
0
def
uniqueValues
(
self
,
name
=
None
,
withLength
=
0
):
""" needed to be consistent with the interface """
...
...
lib/python/Products/PluginIndexes/TopicIndex/TopicIndex.py
View file @
680fb65b
...
...
@@ -11,7 +11,7 @@
#
##############################################################################
__version__
=
'$Id: TopicIndex.py,v 1.1
0 2002/11/28 16:32:02 andreasjung
Exp $'
__version__
=
'$Id: TopicIndex.py,v 1.1
1 2002/12/05 21:35:53 caseman
Exp $'
from
Products.PluginIndexes
import
PluggableIndex
from
Products.PluginIndexes.common.util
import
parseIndexRequest
...
...
@@ -94,7 +94,8 @@ class TopicIndex(Persistent, Implicit, SimpleItem):
return
n
numObjects
=
"does not apply"
def
numObjects
(
self
):
return
"N/A"
def
keys
(
self
):
pass
...
...
lib/python/Products/PluginIndexes/common/PluggableIndex.py
View file @
680fb65b
...
...
@@ -11,8 +11,8 @@
#
##############################################################################
"""Pluggable Index
Base Class
"""
__version__
=
'$Revision: 1.
7
$'
[
11
:
-
2
]
"""Pluggable Index
Interface
"""
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
import
Interface
...
...
@@ -36,14 +36,6 @@ class PluggableIndexInterface(Interface.Base):
def
unindex_object
(
documentId
):
"""Remove the documentId from the index."""
# XXX TextIndex does not implement uniqueValues().
def
uniqueValues
(
name
=
None
,
withLengths
=
0
):
"""Returns the unique values for name.
If 'withLengths' is true, returns a sequence of tuples of
(value, length).
"""
def
_apply_index
(
request
,
cid
=
''
):
"""Apply the index to query parameters given in 'request'.
...
...
@@ -67,3 +59,34 @@ class PluggableIndexInterface(Interface.Base):
records. The second object is a tuple containing the names of
all data fields used.
"""
def
numObjects
():
"""Return the number of indexed objects"""
def
clear
():
"""Empty the index"""
class
UniqueValueIndex
(
PluggableIndexInterface
):
"""An index which can return lists of unique values contained in it"""
def
hasUniqueValuesFor
(
name
):
"""Return true if the index can return the unique values for name"""
def
uniqueValues
(
name
=
None
,
withLengths
=
0
):
"""Return the unique values for name.
If 'withLengths' is true, returns a sequence of tuples of
(value, length)."""
class
SortIndex
(
PluggableIndexInterface
):
"""An index which may be used to sort a set of document ids"""
def
keyForDocument
(
documentId
):
"""Return the sort key that cooresponds to the specified document id
This method is no longer used by ZCatalog, but is left for backwards
compatibility."""
def
documentToKeyMap
():
"""Return an object that supports __getitem__ and may be used to quickly
lookup the sort key given a document id"""
lib/python/Products/PluginIndexes/common/UnIndex.py
View file @
680fb65b
...
...
@@ -13,7 +13,7 @@
"""Simple column indices"""
__version__
=
'$Revision: 1.1
5
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
6
$'
[
11
:
-
2
]
from
Globals
import
Persistent
from
Acquisition
import
Implicit
...
...
@@ -383,7 +383,7 @@ class UnIndex(Persistent, Implicit, SimpleItem):
return
r
,
(
self
.
id
,)
def
hasUniqueValuesFor
(
self
,
name
):
' has unique values for column NAME '
"""has unique values for column name"""
if
name
==
self
.
id
:
return
1
else
:
...
...
@@ -413,11 +413,15 @@ class UnIndex(Persistent, Implicit, SimpleItem):
else
:
l
=
len
(
set
)
rl
.
append
((
i
,
l
))
return
tuple
(
rl
)
return
tuple
(
rl
)
def
keyForDocument
(
self
,
id
):
# This method is superceded by documentToKeyMap
return
self
.
_unindex
[
id
]
def
documentToKeyMap
(
self
):
return
self
.
_unindex
def
items
(
self
):
items
=
[]
for
k
,
v
in
self
.
_index
.
items
():
...
...
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