﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23036	In the tutorial: Why __unicode__() and not __str__()?	anonymous	nobody	"https://docs.djangoproject.com/en/1.4/intro/tutorial01/
Currently says:
""""""
Why __unicode__() and not __str__()?
If you’re familiar with Python, you might be in the habit of adding __str__() methods to your classes, not __unicode__() methods. We use __unicode__() here because Django models deal with Unicode by default. All data stored in your database is converted to Unicode when it’s returned.

Django models have a default __str__() method that calls __unicode__() and converts the result to a UTF-8 bytestring. This means that unicode(p) will return a Unicode string, and str(p) will return a normal string, with characters encoded as UTF-8.

If all of this is gibberish to you, just remember to add __unicode__() methods to your models. With any luck, things should Just Work for you.
""""""

models.Model.__str__??
Type:        function
String form: <function Model.__str__ at 0x7fd0a8cefbf8>
File:        /home/jlo/code/init/django/init/djangoInit/lib/python3.4/site-packages/django/db/models/base.py
Definition:  models.Model.__str__(self)
Source:
    def __str__(self):
        if six.PY2 and hasattr(self, '__unicode__'):
            return force_text(self).encode('utf-8')
        return '%s object' % self.__class__.__name__

If the tutorial is followed to the letter in Python 3, the user will likely be confused as to why their __unicode__() method doesn't seem to be making any difference. Wording in this box could stand to be updated to mention something from the documentation from https://docs.djangoproject.com/en/dev/topics/python3/#str-and-unicode-methods or at least mention that the tutorial was written with Python 2 in mind"	Uncategorized	closed	Documentation	1.6	Normal	invalid	python3		Unreviewed	0	0	0	0	1	0
