diff options
| author | Timo Graham <timograham@gmail.com> | 2012-02-18 21:50:48 +0000 |
|---|---|---|
| committer | Timo Graham <timograham@gmail.com> | 2012-02-18 21:50:48 +0000 |
| commit | 03aa030f07b4b75add143f895f18fd7d54f770ca (patch) | |
| tree | 3ff37a34caf1a4b0a6cc64e6538ac4b03a7b67aa /docs/intro/tutorial02.txt | |
| parent | 25a68c65749d16019988bbb7a96b5e8efdb591f6 (diff) | |
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
Diffstat (limited to 'docs/intro/tutorial02.txt')
| -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 afbc07d804..1cd7136803 100644 --- a/docs/intro/tutorial02.txt +++ b/docs/intro/tutorial02.txt @@ -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``:: |
