Author: timo
Date: 2012-02-18 13:51:18 -0800 (Sat, 18 Feb 2012)
New Revision: 17551

Modified:
   django/branches/releases/1.3.X/docs/intro/tutorial02.txt
Log:
[1.3.X] Fixed #17706 - Improved short description example in Tutorial 2; thanks 
xbito and claudep.

Backport of r17550 from trunk.

Modified: django/branches/releases/1.3.X/docs/intro/tutorial02.txt
===================================================================
--- django/branches/releases/1.3.X/docs/intro/tutorial02.txt    2012-02-18 
21:50:48 UTC (rev 17550)
+++ django/branches/releases/1.3.X/docs/intro/tutorial02.txt    2012-02-18 
21:51:18 UTC (rev 17551)
@@ -343,9 +343,11 @@
 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``::

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to