prepare date for solr 0.7.5
authorJan Szejko <janek37@gmail.com>
Fri, 16 Mar 2018 14:21:08 +0000 (15:21 +0100)
committerJan Szejko <janek37@gmail.com>
Fri, 16 Mar 2018 14:21:08 +0000 (15:21 +0100)
migdal/search_indexes.py
setup.py

index fc35cff..91f7ab7 100644 (file)
@@ -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
 
index 69acd90..a6136b2 100755 (executable)
--- 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',