Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2021
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. class FilmDetailView(DetailView):
  2.  
  3. model = Film
  4. queryset = Film.objects.get(id=id)
  5.  
  6. def get_context_data(self, **kwargs):
  7. # Call the base implementation first to get a context
  8. context = super(FilmDetailView, self).get_context_data(**kwargs)
  9. # Add in a QuerySet of all the books
  10. context['film'] = Film.objects.get(id=id)
  11. return context
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement