Skip to content

Commit

Permalink
Fixed date field index type
Browse files Browse the repository at this point in the history
  • Loading branch information
Michel Pelletier committed May 11, 1999
1 parent 72b747c commit 6cb9144
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Catalog.py
Expand Up @@ -120,10 +120,10 @@ def __init__(self,id,title=None):
('url', 'FieldIndex', 's', 1),
('title', 'TextIndex', 's', None),
('meta_type', 'FieldIndex', 's', None),
('last_modified', 'TextIndex', 'd', None),
('last_modified', 'FieldIndex', 'd', None),
('subject', 'TextIndex', 's', None),
('description', 'TextIndex', 's', None),
('date', 'TextIndex', 'd', None),
('date', 'FieldIndex', 'd', None),
('reviewed', 'FieldIndex', 'i', None),
]

Expand All @@ -142,8 +142,14 @@ def __init__(self,id,title=None):
self._ztable._data.setOrphanIndex('text_content', 'TextIndex',
call_methods=1)

self._ztable._data.addComputedField('modified_since',
'(_.DateTime() - 1)',
index_type='FieldIndex',
type='d')

self._ztable.update_database_schema(uindex, utype, call)


def searchResults(self, REQUEST=None, used=None,
query_map={
type(regex.compile('')): Query.Regex,
Expand All @@ -161,6 +167,7 @@ def searchResults(self, REQUEST=None, used=None,
__call__ = searchResults



def uniqueValuesFor(self, id):
""" return unique values for field index id """
return apply(self._ztable.uniqueValuesFor, (id,))
Expand Down

0 comments on commit 6cb9144

Please sign in to comment.