#26339 closed Uncategorized (fixed)
In tutorial 07, a was_published_recently method definition should be modified to reflect previous modifications
Reported by: | Damien Caselli | Owned by: | nobody |
---|---|---|---|
Component: | Uncategorized | Version: | 1.9 |
Severity: | Normal | Keywords: | docs |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
In the Customize the admin change list section, the Question
class order improvements show an old version of the was_published_recently
method.
It gets improved in the Tutorial 5 section.
It shows:
class Question(models.Model): # ... def was_published_recently(self): return self.pub_date >= timezone.now() - datetime.timedelta(days=1)
When it should be:
class Question(models.Model): # ... def was_published_recently(self): now = timezone.now() return now - datetime.timedelta(days=1) <= self.pub_date <= now
Note:
See TracTickets
for help on using tickets.
In 602a38d: