MCPcopy
hub / github.com/django/django / get_fields

Method get_fields

django/db/models/options.py:865–879  ·  view source on GitHub ↗

Return a list of fields associated to the model. By default, include forward and reverse fields, fields derived from inheritance, but not hidden fields. The returned fields can be changed using the parameters: - include_parents: include fields derived from inheritan

(self, include_parents=True, include_hidden=False)

Source from the content-addressed store, hash-verified

863 self._get_fields_cache = {}
864
865 def get_fields(self, include_parents=True, include_hidden=False):
866 """
867 Return a list of fields associated to the model. By default, include
868 forward and reverse fields, fields derived from inheritance, but not
869 hidden fields. The returned fields can be changed using the parameters:
870
871 - include_parents: include fields derived from inheritance
872 - include_hidden: include fields that have a related_name that
873 starts with a "+"
874 """
875 if include_parents is False:
876 include_parents = PROXY_PARENTS
877 return self._get_fields(
878 include_parents=include_parents, include_hidden=include_hidden
879 )
880
881 def _get_fields(
882 self,

Callers 15

_get_related_modelsFunction · 0.45
_check_related_fieldsMethod · 0.45
_annotateMethod · 0.45
_check_on_deleteMethod · 0.45
test03a_layersMethod · 0.45

Calls 1

_get_fieldsMethod · 0.95