Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed #17706 - Improved short description example in Tutorial 2; than…

…ks xbito and claudep.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17550 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 03aa030f07b4b75add143f895f18fd7d54f770ca 1 parent 25a68c6
Tim Graham timgraham authored
Showing with 5 additions and 3 deletions.
  1. +5 −3 docs/intro/tutorial02.txt
8 docs/intro/tutorial02.txt
View
@@ -356,9 +356,11 @@ an arbitrary method is not supported. Also note that the column header for
underscores replaced with spaces). But you can change that by giving that
method (in ``models.py``) a ``short_description`` attribute::
- def was_published_today(self):
- return self.pub_date.date() == datetime.date.today()
- was_published_today.short_description = 'Published today?'
+ class Poll(models.Model):
+ # ...
+ def was_published_today(self):
+ return self.pub_date.date() == datetime.date.today()
+ was_published_today.short_description = 'Published today?'
Edit your admin.py file again and add an improvement to the Poll change list page: Filters. Add the
following line to ``PollAdmin``::
Please sign in to comment.
Something went wrong with that request. Please try again.