MCPcopy
hub / github.com/django/django / m2m_value

Method m2m_value

django/core/serializers/python.py:69–73  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

67 ):
68
69 def m2m_value(value):
70 if natural := value.natural_key():
71 return natural
72 else:
73 return self._value_from_field(value, value._meta.pk)
74
75 def queryset_iterator(obj, field):
76 attr = getattr(obj, field.name)

Callers

nothing calls this directly

Calls 2

_value_from_fieldMethod · 0.95
natural_keyMethod · 0.45

Tested by

no test coverage detected