#17510: Typo at https://docs.djangoproject.com/en/1.3/topics/class-based-views
/#dynamic-filtering
-------------------------------+--------------------------------------
Reporter: andrew@… | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 1.3
Severity: Normal | Keywords: typo, documentation, web
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+--------------------------------------
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
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/17510>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.