Opened 3 years ago

Closed 3 years ago

#18589 closed Cleanup/optimization (fixed)

Typo in class-based generic views doc

Reported by: cpthomas@… Owned by: nobody
Component: Documentation Version: 1.4
Severity: Normal Keywords: documentation, typo
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

On this page: https://docs.djangoproject.com/en/dev/topics/class-based-views/generic-display/, under the Dynamic Filtering heading, there is a typo in the 3rd code example

PublisherBookListView should be PublisherBookList to match the previous code examples.

Existing:

def get_context_data(self, **kwargs):
    # Call the base implementation first to get a context
    context = super(PublisherBookListView, self).get_context_data(**kwargs)
    # Add in the publisher
    context['publisher'] = self.publisher
    return context

Revised:

# ...

def get_context_data(self, **kwargs):
    # Call the base implementation first to get a context
    context = super(PublisherBookList, self).get_context_data(**kwargs)
    # Add in the publisher
    context['publisher'] = self.publisher
    return context

Change History (2)

comment:1 Changed 3 years ago by aaugustin

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

comment:2 Changed 3 years ago by Aymeric Augustin <aymeric.augustin@…>

  • Resolution set to fixed
  • Status changed from new to closed

In [d94cfdcfae92fd4409cd1b5e14eebc75033266fd]:

Fixed #18589 -- Typo in generic CBV docs.

Thanks cpthomas for the report.

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