Opened 5 years ago

Closed 5 years ago

#20733 closed Bug (fixed)

Minor code error in doc page for DetailView

Reported by: ijl20@… Owned by: nobody
Component: Documentation Version: 1.5
Severity: Normal Keywords: DetailView
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no



Current (2013-July-11) docs give example myapp/article_detail.html:

<h1>{{ object.headline }}</h1>
<p>{{ object.content }}</p>
<p>Reporter: {{ object.reporter }}</p>
<p>Published: {{ object.pub_date|date }}</p>
<p>Date: {{|date }}</p>

the last line should be

<p>Date: {{ now|date }}</p>

Because only adds 'now' to the context, not as a new attribute of the object being rendered, as below. Currently, displays as 'blank'.

    def get_context_data(self, **kwargs):
        context = super(ArticleDetailView, self).get_context_data(**kwargs)
        context['now'] =
        return context

regards - Ian Lewis, Cambridge

Change History (1)

comment:1 Changed 5 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In f93b2fe7e698a9dd48d839465c75b16013b0f652:

[1.6.x] Fixed #20733 -- Typo in docs/ref/class-based-views/generic-display.txt

Thanks ijl20@ for the report.

Backport of ecd746191c from master

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