From 6cb9144b2bad8d6a64d9a08dda3bafc026ef9c78 Mon Sep 17 00:00:00 2001 From: Michel Pelletier Date: Tue, 11 May 1999 01:33:05 +0000 Subject: [PATCH] Fixed date field index type --- Catalog.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Catalog.py b/Catalog.py index 492dde9d..b11493aa 100644 --- a/Catalog.py +++ b/Catalog.py @@ -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), ] @@ -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, @@ -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,))