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

Method models

haystack/query.py:366–381  ·  view source on GitHub ↗

Accepts an arbitrary number of Model classes to include in the search.

(self, *models)

Source from the content-addressed store, hash-verified

364 return clone
365
366 def models(self, *models):
367 """Accepts an arbitrary number of Model classes to include in the search."""
368 clone = self._clone()
369
370 for model in models:
371 if (
372 model
373 not in connections[self.query._using]
374 .get_unified_index()
375 .get_indexed_models()
376 ):
377 warnings.warn("The model %r is not registered for search." % (model,))
378
379 clone.query.add_model(model)
380
381 return clone
382
383 def result_class(self, klass):
384 """

Callers 15

renderMethod · 0.95
test_modelsMethod · 0.95
searchMethod · 0.80
searchMethod · 0.80
get_resultsMethod · 0.80
update_backendMethod · 0.80
test___or__Method · 0.80
test_more_like_thisMethod · 0.80
test___or__Method · 0.80
test_more_like_thisMethod · 0.80
test_handle_saveMethod · 0.80

Calls 4

_cloneMethod · 0.95
get_indexed_modelsMethod · 0.80
get_unified_indexMethod · 0.80
add_modelMethod · 0.80

Tested by 15

test_modelsMethod · 0.76
test___or__Method · 0.64
test_more_like_thisMethod · 0.64
test___or__Method · 0.64
test_more_like_thisMethod · 0.64
test_handle_saveMethod · 0.64
test_handle_deleteMethod · 0.64
test___or__Method · 0.64
test_more_like_thisMethod · 0.64
test_indexingMethod · 0.64