[Django] #36077: Incorrect mention of falsey primary key values in save() documentation

5 views
Skip to first unread message

Django

unread,
Jan 9, 2025, 9:53:24 AMJan 9
to django-...@googlegroups.com
#36077: Incorrect mention of falsey primary key values in save() documentation
-------------------------------------+-------------------------------------
Reporter: Jacob | Owner: Jacob Walls
Walls |
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: 5.1
Documentation |
Severity: Normal | Keywords:
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
This
[https://github.com/django/django/blob/8c118c0e00846091c261b97dbed9a5b89ceb79bf/docs/ref/models/instances.txt#L556
sentence] in the description of `save()` is outdated since
c2ba59fc1da5287d6286e2c2aca4083d5bafe056. We only consider a pk set if
it's not None, as opposed to the empty string (before that commit) nor
other falsey values like 0 (since forever, AFAICT).

[https://github.com/django/django/pull/19019 PR]

Found during
[https://github.com/django/django/pull/19008#discussion_r1907945288 PR
discussion]
--
Ticket URL: <https://code.djangoproject.com/ticket/36077>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 12, 2025, 5:55:07 PMJan 12
to django-...@googlegroups.com
#36077: Incorrect mention of falsey primary key values in save() documentation
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: assigned
Component: Documentation | Version: 5.1
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/36077#comment:1>

Django

unread,
Jan 13, 2025, 5:18:14 AMJan 13
to django-...@googlegroups.com
#36077: Incorrect mention of falsey primary key values in save() documentation
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: closed
Component: Documentation | Version: 5.1
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce <42296566+sarahboyce@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"d66137b39b1503ca3d4d4fac687251adbc845068" d66137b3]:
{{{#!CommitTicketReference repository=""
revision="d66137b39b1503ca3d4d4fac687251adbc845068"
Fixed #36077 -- Corrected docs on pk value where Model.save() executes an
UPDATE.

The empty string is no longer special-cased since
c2ba59fc1da5287d6286e2c2aca4083d5bafe056.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36077#comment:2>

Django

unread,
Jan 13, 2025, 5:20:41 AMJan 13
to django-...@googlegroups.com
#36077: Incorrect mention of falsey primary key values in save() documentation
-------------------------------------+-------------------------------------
Reporter: Jacob Walls | Owner: Jacob
Type: | Walls
Cleanup/optimization | Status: closed
Component: Documentation | Version: 5.1
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Sarah Boyce <42296566+sarahboyce@…>):

In [changeset:"b325864686f1c1ffbe7062618e9cdfe0b5c45a35" b325864]:
{{{#!CommitTicketReference repository=""
revision="b325864686f1c1ffbe7062618e9cdfe0b5c45a35"
[5.1.x] Fixed #36077 -- Corrected docs on pk value where Model.save()
executes an UPDATE.

The empty string is no longer special-cased since
c2ba59fc1da5287d6286e2c2aca4083d5bafe056.

Backport of d66137b39b1503ca3d4d4fac687251adbc845068 from main.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/36077#comment:3>
Reply all
Reply to author
Forward
0 new messages