From 3a7a2d90cfc7437c5dced677d2a406b69bddf02c Mon Sep 17 00:00:00 2001 From: Wim Feijen Date: Fri, 13 Sep 2024 11:38:07 +0200 Subject: [PATCH] Update fields.txt documentation according to Trac ticket 2750, comment 23 See: https://code.djangoproject.com/ticket/2750#comment:23 --- docs/ref/models/fields.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index 612949ab4a..35e0a2a094 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -479,6 +479,8 @@ For fields like :class:`ForeignKey` that map to model instances, defaults should be the value of the field they reference (``pk`` unless :attr:`~ForeignKey.to_field` is set) instead of model instances. +For a :class:`ManyToManyField`, the default is not used when saving the object. + The default value is used when new model instances are created and a value isn't provided for the field. When the field is a primary key, the default is also used when the field is set to ``None``.