#26339 closed Uncategorized (fixed)
In tutorial 07, a was_published_recently method definition should be modified to reflect previous modifications
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: