ElissaM
0
Q:

"must be called with either an object pk or a slug in the URLconf"

class HostDetailPageView(DetailView):
    template_name = 'hosts/hostdetail.html'
    model = Host
    pk_url_kwarg = 'name'

    def get_queryset(self):
        return super().get_queryset().filter(host__name=self.kwargs['host'])
0

New to Communities?

Join the community