Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#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

Change History (2)

comment:1 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: newclosed

In 602a38d:

Fixed #26339 -- Updated Question.was_published_recently() in tutorial 7 to reflect changes in tutorial 5.

comment:2 by Tim Graham <timograham@…>, 8 years ago

In 43bb672:

[1.9.x] Fixed #26339 -- Updated Question.was_published_recently() in tutorial 7 to reflect changes in tutorial 5.

Backport of 602a38d87e4b0d9c5e43678c33208627ca84ce2a from master

Note: See TracTickets for help on using tickets.
Back to Top