MCPcopy Index your code
hub / github.com/django-haystack/django-haystack / __init__

Method __init__

haystack/indexes.py:117–132  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

115 """
116
117 def __init__(self):
118 self.prepared_data = None
119 content_fields = []
120
121 self.field_map = {}
122 for field_name, field in self.fields.items():
123 # form field map
124 self.field_map[field.index_fieldname] = field_name
125 if field.document is True:
126 content_fields.append(field_name)
127
128 if not len(content_fields) == 1:
129 raise SearchFieldError(
130 "The index '%s' must have one (and only one) SearchField with document=True."
131 % self.__class__.__name__
132 )
133
134 def get_model(self):
135 """

Callers 1

__init__Method · 0.45

Calls 1

SearchFieldErrorClass · 0.85

Tested by

no test coverage detected