[Django] #22497: Documentation for deconstruct is wrong

31 views
Skip to first unread message

Django

unread,
Apr 23, 2014, 5:30:17 PM4/23/14
to django-...@googlegroups.com
#22497: Documentation for deconstruct is wrong
-------------------------------+------------------------
Reporter: reames@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.7-beta-2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------
I'm looking at the documentation on
https://docs.djangoproject.com/en/1.7/topics/migrations/ for the
`deconstruct()` method, where it states:

It takes no arguments, and should return a tuple of 3 things: (path,
args, kwargs).

But, it actually should return 4 items as shown in the code:

https://github.com/django/django/blob/stable/1.7.x/django/db/migrations/state.py#L127

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

Django

unread,
Apr 24, 2014, 12:08:01 PM4/24/14
to django-...@googlegroups.com
#22497: Documentation for deconstruct is wrong
-------------------------------+--------------------------------------

Reporter: reames@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.7-beta-2
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 nliberg):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

I too was confused by this at first.
For Fields a 4-tuple including the field name is returned. Documented
here: https://docs.djangoproject.com/en/1.7/howto/custom-model-fields
/#field-deconstruction
For other custom classes a 3-tuple is returned. Documented here:
https://docs.djangoproject.com/en/1.7/topics/migrations/#custom-
deconstruct-method

The latter text should probably mention and link to the former.

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

Django

unread,
Apr 28, 2014, 8:13:49 AM4/28/14
to django-...@googlegroups.com
#22497: Documentation should highlight the different between field and class
deconstruction
-------------------------------------+-------------------------------------
Reporter: reames@… | Owner: timo
Type: | Status: assigned
Cleanup/optimization | Version:
Component: Documentation | 1.7-beta-2
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* status: new => assigned
* owner: nobody => timo
* stage: Unreviewed => Accepted
* type: Uncategorized => Cleanup/optimization


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

Django

unread,
Apr 28, 2014, 8:20:36 AM4/28/14
to django-...@googlegroups.com
#22497: Documentation should highlight the different between field and class
deconstruction
-------------------------------------+-------------------------------------
Reporter: reames@… | Owner: timo
Type: | Status: closed

Cleanup/optimization | Version:
Component: Documentation | 1.7-beta-2
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 0 | 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:"b829d53b37946d5e3148e2c51ae7ec41f470b756"]:
{{{
#!CommitTicketReference repository=""
revision="b829d53b37946d5e3148e2c51ae7ec41f470b756"
Fixed #22497 -- Highlighted difference between field and class
deconstruction.

Thanks nliberg for the suggestion.
}}}

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

Django

unread,
Apr 28, 2014, 8:20:47 AM4/28/14
to django-...@googlegroups.com
#22497: Documentation should highlight the different between field and class
deconstruction
-------------------------------------+-------------------------------------
Reporter: reames@… | Owner: timo
Type: | Status: closed
Cleanup/optimization | Version:
Component: Documentation | 1.7-beta-2
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"63ae243a13759f2a87184784fa268d6d003c694a"]:
{{{
#!CommitTicketReference repository=""
revision="63ae243a13759f2a87184784fa268d6d003c694a"
[1.7.x] Fixed #22497 -- Highlighted difference between field and class
deconstruction.

Thanks nliberg for the suggestion.

Backport of b829d53b37 from master
}}}

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

Reply all
Reply to author
Forward
0 new messages