[Django] #28653: Error in making queries example in documentation

2 views
Skip to first unread message

Django

unread,
Sep 29, 2017, 10:52:41 AM9/29/17
to django-...@googlegroups.com
#28653: Error in making queries example in documentation
--------------------------------------------+------------------------
Reporter: Stefan Schneider | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
--------------------------------------------+------------------------
There's a second required argument needed for `Foreign Key` fields:
`on_delete`
. Since 1.11 not providing the argument gives an `Deprecation Warning` but
since 2.0 it's required and gives an error if not provieded

In the documentation for
[https://docs.djangoproject.com/en/dev/topics/db/queries/ Making Queries]
the example doesn't provide the `on_delete` argument.

{{{
class Entry(models.Model):
blog = models.ForeignKey(Blog)
}}}
should be:
{{{
class Entry(models.Model):
blog = models.ForeignKey(Blog, on_delete='CASCADING')
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28653>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 29, 2017, 10:52:52 AM9/29/17
to django-...@googlegroups.com
#28653: Error in making queries example in documentation
-------------------------------------+-------------------------------------
Reporter: Stefan Schneider | Owner: Stefan
| Schneider
Type: Bug | Status: assigned
Component: Documentation | Version: master
Severity: Normal | Resolution:

Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Stefan Schneider):

* owner: nobody => Stefan Schneider
* status: new => assigned


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

Django

unread,
Sep 29, 2017, 11:31:19 AM9/29/17
to django-...@googlegroups.com
#28653: Missing ForeignKey.on_delete argument in docs

-------------------------------------+-------------------------------------
Reporter: Stefan Schneider | Owner: Stefan
| Schneider
Type: Bug | Status: assigned
Component: Documentation | Version: master
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):

* has_patch: 0 => 1
* stage: Unreviewed => Ready for checkin


Comment:

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

--
Ticket URL: <https://code.djangoproject.com/ticket/28653#comment:2>

Django

unread,
Sep 29, 2017, 11:38:51 AM9/29/17
to django-...@googlegroups.com
#28653: Missing ForeignKey.on_delete argument in docs
-------------------------------------+-------------------------------------
Reporter: Stefan Schneider | Owner: Stefan
| Schneider
Type: Bug | Status: closed
Component: Documentation | Version: master
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 Tim Graham <timograham@…>):

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


Comment:

In [changeset:"08c8c3ead97893ec0e1dece699525ad7ed27c2d7" 08c8c3ea]:
{{{
#!CommitTicketReference repository=""
revision="08c8c3ead97893ec0e1dece699525ad7ed27c2d7"
Fixed #28653 -- Added missing ForeignKey.on_delete argument in docs.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28653#comment:3>

Django

unread,
Sep 29, 2017, 11:38:58 AM9/29/17
to django-...@googlegroups.com
#28653: Missing ForeignKey.on_delete argument in docs
-------------------------------------+-------------------------------------
Reporter: Stefan Schneider | Owner: Stefan
| Schneider
Type: Bug | Status: closed
Component: Documentation | Version: master

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 Tim Graham <timograham@…>):

In [changeset:"eff5f837c9dd887137a54475b3a5fcd968336f16" eff5f83]:
{{{
#!CommitTicketReference repository=""
revision="eff5f837c9dd887137a54475b3a5fcd968336f16"
[2.0.x] Fixed #28653 -- Added missing ForeignKey.on_delete argument in
docs.

Backport of 08c8c3ead97893ec0e1dece699525ad7ed27c2d7 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28653#comment:4>

Django

unread,
Sep 29, 2017, 11:39:09 AM9/29/17
to django-...@googlegroups.com
#28653: Missing ForeignKey.on_delete argument in docs
-------------------------------------+-------------------------------------
Reporter: Stefan Schneider | Owner: Stefan
| Schneider
Type: Bug | Status: closed
Component: Documentation | Version: master

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 Tim Graham <timograham@…>):

In [changeset:"251190cc5956c835a1d7dd3bd084370f0ec50cb5" 251190cc]:
{{{
#!CommitTicketReference repository=""
revision="251190cc5956c835a1d7dd3bd084370f0ec50cb5"
[1.11.x] Fixed #28653 -- Added missing ForeignKey.on_delete argument in
docs.

Backport of 08c8c3ead97893ec0e1dece699525ad7ed27c2d7 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28653#comment:5>

Reply all
Reply to author
Forward
0 new messages