MCPcopy
hub / github.com/django/django / __init__

Method __init__

django/forms/models.py:1387–1397  ·  view source on GitHub ↗
(self, parent_instance, *args, pk_field=False, to_field=None, **kwargs)

Source from the content-addressed store, hash-verified

1385 }
1386
1387 def __init__(self, parent_instance, *args, pk_field=False, to_field=None, **kwargs):
1388 self.parent_instance = parent_instance
1389 self.pk_field = pk_field
1390 self.to_field = to_field
1391 if self.parent_instance is not None:
1392 if self.to_field:
1393 kwargs["initial"] = getattr(self.parent_instance, self.to_field)
1394 else:
1395 kwargs["initial"] = self.parent_instance.pk
1396 kwargs["required"] = False
1397 super().__init__(*args, **kwargs)
1398
1399 def clean(self, value):
1400 if value in self.empty_values:

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected