Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#17510 closed Bug (fixed)

Typo at https://docs.djangoproject.com/en/1.3/topics/class-based-views/#dynamic-filtering

Reported by: andrew@… Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords: typo, documentation, web
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

A comma behind the template name in the code blocks

from django.shortcuts import get_object_or_404
from django.views.generic import ListView
from books.models import Book, Publisher

class PublisherBookListView(ListView):

    context_object_name = "book_list"
    template_name = "books/books_by_publisher.html",

    def get_queryset(self):
        publisher = get_object_or_404(Publisher, name__iexact=self.args[0])
        return Book.objects.filter(publisher=publisher)
class PublisherBookListView(ListView):

    context_object_name = "book_list"
    template_name = "books/books_by_publisher.html",

    def get_queryset(self):
        self.publisher = get_object_or_404(Publisher, name__iexact=self.args[0])
        return Book.objects.filter(publisher=self.publisher)

    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

Attachments (1)

patch_17510.diff (965 bytes ) - added by noria 13 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by anonymous, 13 years ago

Throws a "TypeError cannot concatenate a 'str' and 'tuple'" or something like that error

by noria, 13 years ago

Attachment: patch_17510.diff added

comment:2 by noria, 13 years ago

Has patch: set
Triage Stage: UnreviewedAccepted

comment:3 by Claude Paroz, 13 years ago

Triage Stage: AcceptedReady for checkin
Type: UncategorizedBug
Version: 1.3SVN

comment:4 by Tim Graham, 13 years ago

Resolution: fixed
Status: newclosed

In [17457]:

Fixed #17510 - Typo in docs/topics/class-based-views.txt; thanks andrew and noria.

comment:5 by Tim Graham, 13 years ago

In [17458]:

[1.3.X] Fixed #17510 - Typo in docs/topics/class-based-views.txt; thanks andrew and noria.

Backport of r17457 from trunk.

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