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
- def index_queryset(self, using=None):
- """Used when the entire index for model is updated."""
- return self.get_model().objects.all()
-
add_translatable_index(EntryIndex, {
'title': indexes.CharField(null=True),