MCPcopy
hub / github.com/django/django / fields_map

Method fields_map

django/db/models/options.py:656–668  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

654
655 @cached_property
656 def fields_map(self):
657 res = {}
658 fields = self._get_fields(forward=False, include_hidden=True)
659 for field in fields:
660 res[field.name] = field
661 # Due to the way Django's internals work, get_field() should also
662 # be able to fetch a field by attname. In the case of a concrete
663 # field with relation, includes the *_id name too
664 try:
665 res[field.attname] = field
666 except AttributeError:
667 pass
668 return res
669
670 def get_field(self, field_name):
671 """

Callers

nothing calls this directly

Calls 1

_get_fieldsMethod · 0.95

Tested by

no test coverage detected