Refs #23919 -- Replaced super(ClassName, self) with super() in docs.

This commit is contained in:
chillaranand 2017-01-22 12:27:14 +05:30 committed by Tim Graham
parent 2d96c027f5
commit dc165ec8e5
36 changed files with 103 additions and 104 deletions

View file

@ -218,7 +218,7 @@ template, but you can override it to send more::
def get_context_data(self, **kwargs):
# Call the base implementation first to get a context
context = super(PublisherDetail, self).get_context_data(**kwargs)
context = super().get_context_data(**kwargs)
# Add in a QuerySet of all the books
context['book_list'] = Book.objects.all()
return context
@ -365,7 +365,7 @@ use it in the template::
def get_context_data(self, **kwargs):
# Call the base implementation first to get a context
context = super(PublisherBookList, self).get_context_data(**kwargs)
context = super().get_context_data(**kwargs)
# Add in the publisher
context['publisher'] = self.publisher
return context
@ -419,7 +419,7 @@ object -- so we simply override it and wrap the call::
def get_object(self):
# Call the superclass
object = super(AuthorDetailView, self).get_object()
object = super().get_object()
# Record the last accessed date
object.last_accessed = timezone.now()
object.save()