Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[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
  • Loading branch information...
commit 9729ad7466b25af4ae396d751c1a86541434a221 1 parent 5144f72
Tim Graham authored February 18, 2012

Showing 1 changed file with 5 additions and 3 deletions. Show diff stats Hide diff stats

  1. 8  docs/intro/tutorial02.txt
8  docs/intro/tutorial02.txt
@@ -343,9 +343,11 @@ an arbitrary method is not supported. Also note that the column header for
343 343
 underscores replaced with spaces). But you can change that by giving that
344 344
 method (in ``models.py``) a ``short_description`` attribute::
345 345
 
346  
-    def was_published_today(self):
347  
-        return self.pub_date.date() == datetime.date.today()
348  
-    was_published_today.short_description = 'Published today?'
  346
+    class Poll(models.Model):
  347
+        # ...
  348
+        def was_published_today(self):
  349
+            return self.pub_date.date() == datetime.date.today()
  350
+        was_published_today.short_description = 'Published today?'
349 351
 
350 352
 Edit your admin.py file again and add an improvement to the Poll change list page: Filters. Add the
351 353
 following line to ``PollAdmin``::

0 notes on commit 9729ad7

Please sign in to comment.
Something went wrong with that request. Please try again.