MCPcopy
hub / github.com/django/django / _get_FIELD_display

Method _get_FIELD_display

django/db/models/base.py:1335–1341  ·  view source on GitHub ↗
(self, field)

Source from the content-addressed store, hash-verified

1333 adelete.alters_data = True
1334
1335 def _get_FIELD_display(self, field):
1336 value = getattr(self, field.attname)
1337 choices_dict = dict(make_hashable(field.flatchoices))
1338 # force_str() to coerce lazy strings.
1339 return force_str(
1340 choices_dict.get(make_hashable(value), value), strings_only=True
1341 )
1342
1343 def _get_next_or_previous_by_FIELD(self, field, is_next, **kwargs):
1344 if not self._is_pk_set():

Callers

nothing calls this directly

Calls 3

make_hashableFunction · 0.90
force_strFunction · 0.90
getMethod · 0.45

Tested by

no test coverage detected