diff options
| author | Yash <yashraj504300@gmail.com> | 2024-10-16 14:38:31 +0530 |
|---|---|---|
| committer | Sarah Boyce <42296566+sarahboyce@users.noreply.github.com> | 2024-10-23 11:48:30 +0200 |
| commit | 35ab2e018214479fa712d73f070198299ef670a1 (patch) | |
| tree | fbcfd28d37801f1d7c6d712e50c5e90c6936a5a2 /docs/ref | |
| parent | 04adff9f98a93a546d7b4d7453b80965233d22a3 (diff) | |
Fixed #35731 -- Extended db_default docs.
This added a missing db_default reference in docs/topics/db/models.txt,
and added a reference to the DatabaseDefault object.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/models/fields.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index febb45108d..b2da1b519c 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -426,6 +426,11 @@ precedence when creating instances in Python code. ``db_default`` will still be set at the database level and will be used when inserting rows outside of the ORM or when adding a new field in a migration. +If a field has a ``db_default`` without a ``default`` set and no value is +assigned to the field, a ``DatabaseDefault`` object is returned as the field +value on unsaved model instances. The actual value for the field is determined +by the database when the model instance is saved. + ``db_index`` ------------ |
