Opened 10 years ago

Closed 10 years ago

#11135 closed (invalid)

'was_published_today' in Tutorial 2

Reported by: Marcin Pekalski <mpekalski@…> Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords: tutorial
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The line

list_display = ('question', 'pub_date', 'was_published_today')

should be changed to

list_display = ('question', 'pub_date', was_published_today)

[no ' ' over was_published_today]

Moreover, I think there should be a word or two that datetime sould be imported in

Change History (1)

comment:1 Changed 10 years ago by Karen Tracey

Resolution: invalid
Status: newclosed

Why do you think the quotes should be removed? was_published_today, as set up in the first part of the tutorial, is a method of the Poll model, not an independent callable. The way it is specified in list display in the 2nd part of the tutorial matches how it should be based on the doc under list_display here:

Also, when the method is defined in the 1st part of the tutorial 'import datetime' is shown as part of the code snippet for adding the was_published_today method. It is not necessary to repeat that in part 2 -- the code should already be there from completing part 1, where it was explicitly noted that 'import datetime' is needed for that bit of code.

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