summaryrefslogtreecommitdiff
path: root/docs/intro
diff options
context:
space:
mode:
authorTim Graham <timograham@gmail.com>2016-03-09 11:21:33 -0500
committerTim Graham <timograham@gmail.com>2016-03-09 11:21:33 -0500
commit602a38d87e4b0d9c5e43678c33208627ca84ce2a (patch)
tree5f87ef62cca8af90e01bbbf6d4a5b73337ea00b4 /docs/intro
parent2bdc9616f469c6b303bdc2711305ce9a1abbdcb6 (diff)
Fixed #26339 -- Updated Question.was_published_recently() in tutorial 7 to reflect changes in tutorial 5.
Diffstat (limited to 'docs/intro')
-rw-r--r--docs/intro/tutorial07.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/docs/intro/tutorial07.txt b/docs/intro/tutorial07.txt
index ecfd90d7f2..cc39abf247 100644
--- a/docs/intro/tutorial07.txt
+++ b/docs/intro/tutorial07.txt
@@ -232,7 +232,8 @@ attributes, as follows:
class Question(models.Model):
# ...
def was_published_recently(self):
- return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
+ now = timezone.now()
+ return now - datetime.timedelta(days=1) <= self.pub_date <= now
was_published_recently.admin_order_field = 'pub_date'
was_published_recently.boolean = True
was_published_recently.short_description = 'Published recently?'