summaryrefslogtreecommitdiff
path: root/docs/tutorial01.txt
diff options
context:
space:
mode:
authorAdrian Holovaty <adrian@holovaty.com>2006-04-30 03:42:53 +0000
committerAdrian Holovaty <adrian@holovaty.com>2006-04-30 03:42:53 +0000
commita8572b18a9a2bb2b73950ce078f7c3aae9e8e5af (patch)
tree823ca0531778874d86feb7b83fec70465fbd1dec /docs/tutorial01.txt
parent5917d90e3027572231d15dba44badfd1d2be9073 (diff)
magic-removal: Replaced __repr__() with __str__() in docs
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2795 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/tutorial01.txt')
-rw-r--r--docs/tutorial01.txt10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/tutorial01.txt b/docs/tutorial01.txt
index 8ce9f6539d..02d2795261 100644
--- a/docs/tutorial01.txt
+++ b/docs/tutorial01.txt
@@ -456,20 +456,20 @@ Once you're in the shell, explore the database API::
Wait a minute. ``<Poll object>`` is, utterly, an unhelpful representation of
this object. Let's fix that by editing the polls model
-(in the ``polls/models.py`` file) and adding a ``__repr__()`` method to
+(in the ``polls/models.py`` file) and adding a ``__str__()`` method to
both ``Poll`` and ``Choice``::
class Poll(models.Model):
# ...
- def __repr__(self):
+ def __str__(self):
return self.question
class Choice(models.Model):
# ...
- def __repr__(self):
+ def __str__(self):
return self.choice
-It's important to add ``__repr__()`` methods to your models, not only for your
+It's important to add ``__str__()`` methods to your models, not only for your
own sanity when dealing with the interactive prompt, but also because objects'
representations are used throughout Django's automatically-generated admin.
@@ -491,7 +491,7 @@ Let's jump back into the Python interactive shell by running
>>> from mysite.polls.models import Poll, Choice
- # Make sure our __repr__() addition worked.
+ # Make sure our __str__() addition worked.
>>> Poll.objects.all()
[What's up?]