fnp
/
prawokultury.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Images and icons
[prawokultury.git]
/
migdal
/
search_indexes.py
diff --git
a/migdal/search_indexes.py
b/migdal/search_indexes.py
index
63acc1c
..
27169f3
100644
(file)
--- a/
migdal/search_indexes.py
+++ b/
migdal/search_indexes.py
@@
-1,8
+1,8
@@
-from django.conf import settings
import datetime
import datetime
+from django.conf import settings
from haystack import indexes
from haystack import indexes
+from fnpdjango.utils.models.translation import add_translatable_index
from migdal.models import Entry
from migdal.models import Entry
-from migdal.helpers import add_translatable_index
class EntryIndex(indexes.RealTimeSearchIndex, indexes.Indexable):
class EntryIndex(indexes.RealTimeSearchIndex, indexes.Indexable):
@@
-14,13
+14,13
@@
class EntryIndex(indexes.RealTimeSearchIndex, indexes.Indexable):
def index_queryset(self):
"""Used when the entire index for model is updated."""
def index_queryset(self):
"""Used when the entire index for model is updated."""
- return self.get_model().objects.filter(date__lte=datetime.datetime.now())
+ return self.get_model().objects.
all() #
filter(date__lte=datetime.datetime.now())
add_translatable_index(EntryIndex, {
add_translatable_index(EntryIndex, {
- 'title': indexes.CharField(),
- 'lead': indexes.CharField(),
- 'body': indexes.CharField()
+ 'title': indexes.CharField(
null=True
),
+ 'lead': indexes.CharField(
null=True
),
+ 'body': indexes.CharField(
null=True
)
})
})