provide general-purpose 'loops_keywords' index
git-svn-id: svn://svn.cy55.de/Zope3/src/loops/trunk@3810 fd906abe-77d9-0310-91a1-e0d9ade77398
This commit is contained in:
parent
2d7ebd0288
commit
6b8545754c
2 changed files with 16 additions and 0 deletions
|
@ -461,6 +461,9 @@ class IndexAttributes(object):
|
||||||
return getName(self.context)
|
return getName(self.context)
|
||||||
return id
|
return id
|
||||||
|
|
||||||
|
def keywords(self):
|
||||||
|
if self.adaptedIndexAttributes is not None:
|
||||||
|
return self.adaptedIndexAttributes.keywords()
|
||||||
|
|
||||||
# events
|
# events
|
||||||
|
|
||||||
|
|
|
@ -43,6 +43,7 @@ textIndex = ('', 'loops_text')
|
||||||
typeIndex = ('', 'loops_type')
|
typeIndex = ('', 'loops_type')
|
||||||
identifierIndex = ('', 'loops_identifier')
|
identifierIndex = ('', 'loops_identifier')
|
||||||
stateIndex = ('', 'loops_state')
|
stateIndex = ('', 'loops_state')
|
||||||
|
keywordsIndex = ('', 'loops_keywords')
|
||||||
|
|
||||||
|
|
||||||
# standard text/field/keyword index queries
|
# standard text/field/keyword index queries
|
||||||
|
@ -73,6 +74,18 @@ def State(statesDefinition, value):
|
||||||
value = [value]
|
value = [value]
|
||||||
return AnyOf(stateIndex, [':'.join((statesDefinition, v)) for v in value])
|
return AnyOf(stateIndex, [':'.join((statesDefinition, v)) for v in value])
|
||||||
|
|
||||||
|
@implementer(IQuery)
|
||||||
|
def KeywordsAllOff(statesDefinition, value):
|
||||||
|
if not isinstance(value, (list, tuple)):
|
||||||
|
value = [value]
|
||||||
|
return AllOf(keywordsIndex, [':'.join((statesDefinition, v)) for v in value])
|
||||||
|
|
||||||
|
@implementer(IQuery)
|
||||||
|
def KeywordsAnyOff(statesDefinition, value):
|
||||||
|
if not isinstance(value, (list, tuple)):
|
||||||
|
value = [value]
|
||||||
|
return AnyOf(keywordsIndex, [':'.join((statesDefinition, v)) for v in value])
|
||||||
|
|
||||||
|
|
||||||
# concept map queries
|
# concept map queries
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue