[Answer]-Django haystack error: AttributeError: object has no attribute 'fields'

1👍

The error is in the class attribute. Just replace SearchField by SearchIndex in the class attributes, change:

class CustomerIndex(indexes.SearchField, indexes.Indexable):

to:

class CustomerIndex(indexes.SearchIndex, indexes.Indexable):

0👍

Another reason that could cause that is using normal drf’s default ModelViewSet instead of HaystackViewSet

👤Ramast

Leave a comment