Fixed #17706 - Improved short description example in Tutorial 2; thanks xbito and claudep.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17550 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Timo Graham 2012-02-18 21:50:48 +00:00
parent 25a68c6574
commit 03aa030f07
1 changed files with 5 additions and 3 deletions

View File

@ -356,6 +356,8 @@ 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 underscores replaced with spaces). But you can change that by giving that
method (in ``models.py``) a ``short_description`` attribute:: method (in ``models.py``) a ``short_description`` attribute::
class Poll(models.Model):
# ...
def was_published_today(self): def was_published_today(self):
return self.pub_date.date() == datetime.date.today() return self.pub_date.date() == datetime.date.today()
was_published_today.short_description = 'Published today?' was_published_today.short_description = 'Published today?'