Skip to content

Commit

Permalink
Fixed #17706 - Improved short description example in Tutorial 2; than…
Browse files Browse the repository at this point in the history
…ks xbito and claudep.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17550 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
timgraham committed Feb 18, 2012
1 parent 25a68c6 commit 03aa030
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions docs/intro/tutorial02.txt
Expand Up @@ -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``::
Expand Down

0 comments on commit 03aa030

Please sign in to comment.