1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

Update fields.txt documentation according to Trac ticket 2750, comment 23

See: https://code.djangoproject.com/ticket/2750#comment:23
This commit is contained in:
Wim Feijen 2024-09-13 11:38:07 +02:00 committed by GitHub
parent 16af0c60ed
commit 3a7a2d90cf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 should be the value of the field they reference (``pk`` unless
:attr:`~ForeignKey.to_field` is set) instead of model instances. :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 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 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``. also used when the field is set to ``None``.