Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[1.6.x] Fixed #20691 -- Added a note for __str__() vs. __unicode__() …

…and Python 3.

Thanks garrison for the suggestion.

Backport of 8a67938 from master.
  • Loading branch information...
commit b36f55c5a5bc7e3dac8a811973c7f7ad1c92d7c5 1 parent 5ecdf0e
Tim Graham authored

Showing 1 changed file with 7 additions and 0 deletions. Show diff stats Hide diff stats

  1. 7  docs/ref/unicode.txt
7  docs/ref/unicode.txt
@@ -240,6 +240,13 @@ Django will convert it to Unicode when it needs to.
240 240
 Choosing between ``__str__()`` and ``__unicode__()``
241 241
 ----------------------------------------------------
242 242
 
  243
+.. note::
  244
+
  245
+    If you are on Python 3, you can skip this section because you'll always
  246
+    create ``__str__()`` rather than ``__unicode__()``. If you'd like
  247
+    compatibility with Python 2, you can decorate your model class with
  248
+    :func:`~django.utils.encoding.python_2_unicode_compatible`.
  249
+
243 250
 One consequence of using Unicode by default is that you have to take some care
244 251
 when printing data from the model.
245 252
 

0 notes on commit b36f55c

Please sign in to comment.
Something went wrong with that request. Please try again.