Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#25462 closed Cleanup/optimization (fixed)

Move __unicode__ documentation and its notice after __str__

Reported by: Simon Charette Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

In the 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.

Change History (7)

comment:1 by Simon Charette, 8 years ago

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

comment:2 by Tim Graham, 8 years ago

Triage Stage: UnreviewedAccepted

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?".

in reply to:  2 comment:3 by Simon Charette, 8 years ago

Replying to 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.

comment:4 by Tim Graham, 8 years ago

Has patch: set

comment:5 by Simon Charette, 8 years ago

Triage Stage: AcceptedReady for checkin

LGTM, thanks Tim!

comment:6 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: newclosed

In de99f558:

Fixed #25462 -- Removed Model.unicode() in favor of @python_2_unicode_compatible.

comment:7 by Tim Graham <timograham@…>, 8 years ago

In 260e9f15:

[1.9.x] Fixed #25462 -- Removed Model.unicode() in favor of @python_2_unicode_compatible.

Backport of de99f558d806a2a1b30072ec95bc44d412d80dab from master

Note: See TracTickets for help on using tickets.
Back to Top