Changes between Initial Version and Version 2 of Ticket #19211
- Timestamp:
- Oct 30, 2012, 2:47:15 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #19211
- Property Triage Stage Unreviewed → Accepted
- Property Summary 1.5 Tutorial wrong about __unicode__() method for Python 3 → Tutorial 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)1 When using Python 3.3 and 1.5-alpha-1. 2 2 3 See this section of the tutorial "Why __unicode__() and not __str__()?": https://docs.djangoproject.com/en/1.5/intro/tutorial01/#playing-with-the-api3 See this section of the tutorial "Why `__unicode__()` and not `__str__()`?": https://docs.djangoproject.com/en/1.5/intro/tutorial01/#playing-with-the-api 4 4 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.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.