1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Fixed #21951 -- Updated docs to use __str__ for Python 3

Thanks Tim Graham for the report and recommendations
This commit is contained in:
Alasdair Nicol
2014-02-09 11:38:13 +00:00
committed by Tim Graham
parent c3434fed5b
commit 8aa1efff6d
20 changed files with 71 additions and 72 deletions

View File

@@ -57,8 +57,7 @@ simple news application with an ``Article`` model::
body = models.TextField()
status = models.CharField(max_length=1, choices=STATUS_CHOICES)
# On Python 3: def __str__(self):
def __unicode__(self):
def __str__(self): # __unicode__ on Python 2
return self.title
A common task we might perform with a model like this is to update an