Initial Import.

This commit is contained in:
2013-03-31 23:15:07 +01:00
commit c19f2f5562
66 changed files with 1780 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
from haystack import indexes
from .models import Store
class StoreIndex(indexes.SearchIndex, indexes.Indexable):
text = indexes.CharField(document=True, use_template=True)
address = indexes.CharField(model_attr='address__full_address')
location = indexes.LocationField(model_attr='address__geo_location')
def get_model(self):
return Store
def index_queryset(self, using=None):
"""Used when the entire index for model is updated."""
return self.get_model().objects.filter(active=True)