From: Jan Szejko Date: Fri, 16 Mar 2018 14:21:08 +0000 (+0100) Subject: prepare date for solr X-Git-Tag: 0.7.5 X-Git-Url: https://git.mdrn.pl/django-migdal.git/commitdiff_plain/a27ee0d568b036a71d7e5c9389c701c8480acd11?ds=inline prepare date for solr --- diff --git a/migdal/search_indexes.py b/migdal/search_indexes.py index fc35cff..91f7ab7 100644 --- a/migdal/search_indexes.py +++ b/migdal/search_indexes.py @@ -16,6 +16,12 @@ class EntryIndex(indexes.SearchIndex, indexes.Indexable): date = indexes.DateTimeField(indexed=True, model_attr="date") author = indexes.CharField(model_attr="author") + def prepare_date(self, obj): + date = u'' + if 'date' in self.prepared_data: + date = self.prepared_data['date'].strftime('%Y-%m-%dT%H:%M:%SZ') + return date + def get_model(self): return Entry diff --git a/setup.py b/setup.py index 69acd90..a6136b2 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ def whole_trees(package_dir, paths): setup( name='django-migdal', - version='0.7.4', + version='0.7.5', author='Radek Czajka', author_email='radoslaw.czajka@nowoczesnapolska.org.pl', maintainer='Jan Szejko',