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

Function model_choices

haystack/forms.py:13–18  ·  view source on GitHub ↗
(using=DEFAULT_ALIAS)

Source from the content-addressed store, hash-verified

11
12
13def model_choices(using=DEFAULT_ALIAS):
14 choices = [
15 (get_model_ct(m), capfirst(smart_str(m._meta.verbose_name_plural)))
16 for m in connections[using].get_unified_index().get_indexed_models()
17 ]
18 return sorted(choices, key=lambda x: x[1])
19
20
21class SearchForm(forms.Form):

Callers 3

test_model_choicesMethod · 0.90
__init__Method · 0.85

Calls 3

get_model_ctFunction · 0.90
get_indexed_modelsMethod · 0.80
get_unified_indexMethod · 0.80

Tested by 2

test_model_choicesMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…