diff options
| author | Timo Graham <timograham@gmail.com> | 2012-02-18 21:51:18 +0000 |
|---|---|---|
| committer | Timo Graham <timograham@gmail.com> | 2012-02-18 21:51:18 +0000 |
| commit | 9729ad7466b25af4ae396d751c1a86541434a221 (patch) | |
| tree | bf59dcb025977f82fa9fe4708ac47da73929a4bd /docs | |
| parent | 5144f72be25b401cd6b37d842b58514cca6a948a (diff) | |
[1.3.X] Fixed #17706 - Improved short description example in Tutorial 2; thanks xbito and claudep.
Backport of r17550 from trunk.
git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.3.X@17551 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/intro/tutorial02.txt | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/docs/intro/tutorial02.txt b/docs/intro/tutorial02.txt index 1e837e6c27..7d1a3e977d 100644 --- a/docs/intro/tutorial02.txt +++ b/docs/intro/tutorial02.txt @@ -343,9 +343,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``:: |
