You can get it from self.kwargs['pk'].
I’m not sure why you want to, though, since the superclass already gets the Book corresponding to that pk – that’s the whole point of a DetailView.
You can get it from self.kwargs['pk'].
I’m not sure why you want to, though, since the superclass already gets the Book corresponding to that pk – that’s the whole point of a DetailView.