[Django] #25462: Move __unicode__ documentation and its notice after __str__

18 views
Skip to first unread message

Django

unread,
Sep 24, 2015, 7:03:32 PM9/24/15
to django-...@googlegroups.com
#25462: Move __unicode__ documentation and its notice after __str__
------------------------------------------------+------------------------
Reporter: charettes | Owner: nobody
Type: Cleanup/optimization | 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 |
------------------------------------------------+------------------------
In the [https://docs.djangoproject.com/en/dev/ref/models/instances/#other-
model-instance-methods other model instance methods] doc we start by
documenting by a notice about `__unicode__` vs `__str__` followed by the
actual `__unicode__` and `__str__` documentation.

Because of the way blocks are arranged it's not clear the notice is about
`__unicode__` vs `__str__` or and not ''other model instance methods'' in
general.

Since the tutorial is oriented toward Python 3 I would suggest we reorder
the doc blocks as follow:

1. `__str__`;
2. `__str__` vs `__unicode__` notice;
3. `__unicode__`.

It should make it clear the notice is about interaction of both methods
and express our preference toward Python 3.

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

Django

unread,
Sep 24, 2015, 7:10:11 PM9/24/15
to django-...@googlegroups.com
#25462: Move __unicode__ documentation and its notice after __str__
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: nobody
Type: | Status: new
Cleanup/optimization |
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
-------------------------------------+-------------------------------------

Comment (by charettes):

Actually this whole section would benefit of a small rewrite with Python 3
in mind.

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

Django

unread,
Sep 24, 2015, 7:56:51 PM9/24/15
to django-...@googlegroups.com
#25462: Move __unicode__ documentation and its notice after __str__
--------------------------------------+------------------------------------

Reporter: charettes | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
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 timgraham):

* stage: Unreviewed => Accepted


Comment:

I think I would remove the heading/and method annotation for `__unicode__`
and leave it mentioned in a note box under `__str__` with a title like
"Using Python 2?".

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

Django

unread,
Sep 24, 2015, 8:00:54 PM9/24/15
to django-...@googlegroups.com
#25462: Move __unicode__ documentation and its notice after __str__
--------------------------------------+------------------------------------

Reporter: charettes | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
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
--------------------------------------+------------------------------------

Comment (by charettes):

Replying to [comment:2 timgraham]:


> I think I would remove the heading/and method annotation for
`__unicode__` and leave it mentioned in a note box under `__str__` with a
title like "Using Python 2?".

Makes sense to me.

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

Django

unread,
Sep 25, 2015, 1:31:53 PM9/25/15
to django-...@googlegroups.com
#25462: Move __unicode__ documentation and its notice after __str__
--------------------------------------+------------------------------------

Reporter: charettes | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Documentation | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timgraham):

* has_patch: 0 => 1


Comment:

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

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

Django

unread,
Sep 25, 2015, 2:08:31 PM9/25/15
to django-...@googlegroups.com
#25462: Move __unicode__ documentation and its notice after __str__
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: nobody
Type: | Status: new
Cleanup/optimization |
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 charettes):

* stage: Accepted => Ready for checkin


Comment:

LGTM, thanks Tim!

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

Django

unread,
Sep 25, 2015, 3:35:47 PM9/25/15
to django-...@googlegroups.com
#25462: Move __unicode__ documentation and its notice after __str__
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
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: new => closed
* resolution: => fixed


Comment:

In [changeset:"de99f558d806a2a1b30072ec95bc44d412d80dab" de99f558]:
{{{
#!CommitTicketReference repository=""
revision="de99f558d806a2a1b30072ec95bc44d412d80dab"
Fixed #25462 -- Removed Model.__unicode__() in favor of
@python_2_unicode_compatible.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25462#comment:6>

Django

unread,
Sep 25, 2015, 3:36:27 PM9/25/15
to django-...@googlegroups.com
#25462: Move __unicode__ documentation and its notice after __str__
-------------------------------------+-------------------------------------
Reporter: charettes | Owner: nobody
Type: | Status: closed
Cleanup/optimization |
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:"260e9f15fe05226188a63ef8e30fa069e48f2660" 260e9f15]:
{{{
#!CommitTicketReference repository=""
revision="260e9f15fe05226188a63ef8e30fa069e48f2660"
[1.9.x] Fixed #25462 -- Removed Model.__unicode__() in favor of
@python_2_unicode_compatible.

Backport of de99f558d806a2a1b30072ec95bc44d412d80dab from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25462#comment:7>

Reply all
Reply to author
Forward
0 new messages