Advertisement
Guest User

Untitled

a guest
Aug 18th, 2019
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. from oscar.apps.search.search_indexes import ProductIndex as AbstractProductIndex
  2.  
  3. class ProductIndex(AbstractProductIndex):
  4. def index_queryset(self, using=None):
  5. # Only index browsable products (not each individual child product)
  6. return self.get_model().objects.all().order_by('-date_updated')
  7.  
  8. def read_queryset(self, using=None):
  9. return self.get_model().objects.all().base_queryset()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement