Answers for "detail view use slug or anything else pk"

0

detail view use slug or anything else pk

class TicketDetail(DetailView):
    model = Ticket

    def get_object(self, queryset=None):
        return Ticket.objects.get(uuid=self.kwargs.get("uuid"))
Posted by: Guest on May-01-2021

Browse Popular Code Answers by Language