Changes between Initial Version and Version 2 of Ticket #19211


Ignore:
Timestamp:
Oct 30, 2012, 2:47:15 PM (12 years ago)
Author:
Luke Plant
Comment:

Description fixed - you can include literal code by enclosing in backticks, as described on WikiFormatting.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #19211

    • Property Triage Stage UnreviewedAccepted
    • Property Summary 1.5 Tutorial wrong about __unicode__() method for Python 3Tutorial must be updated for Python 3
  • Ticket #19211 – Description

    initial v2  
    1 When using Python 3.3 and 1.5-alpha-1 (note: underlined unicode() and str() below should have double underscores)
     1When using Python 3.3 and 1.5-alpha-1.
    22
    3 See this section of the tutorial "Why __unicode__() and not __str__()?": https://docs.djangoproject.com/en/1.5/intro/tutorial01/#playing-with-the-api
     3See this section of the tutorial "Why `__unicode__()` and not `__str__()`?": https://docs.djangoproject.com/en/1.5/intro/tutorial01/#playing-with-the-api
    44
    5 This section of the tutorial says to add __unicode__() method to your Model classes so that admin and shell display useful strings. This is correct for Python 2.x, but breaks object display under Python 3.3. __str__() should be used instead of __unicode__(). Tutorial probably needs a sidebar or other additional information for users using Python 3.x.
     5This section of the tutorial says to add `__unicode__()` method to your Model classes so that admin and shell display useful strings. This is correct for Python 2.x, but breaks object display under Python 3.3. `__str__()` should be used instead of `__unicode__()`. Tutorial probably needs a sidebar or other additional information for users using Python 3.x.
Back to Top