Answer the question
In order to leave comments, you need to log in
Fix the mixin?
When writing
from django.shortcuts import render
from django.shortcuts import get_object_or_404
from . models import *
class ObjectDetailMixin:
model = None
template = None
def get(self, request, slug):
obj = Tag.objects.get(slug__iexact=slug)
return render(request, self.template, context={self.model.__name__.lower(): obj})
Answer the question
In order to leave comments, you need to log in
You have a typo: the letter j is missing in the lineobj = Post.obects.get(slug__iexact=slug)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question