diff --git a/fet2020/posts/views.py b/fet2020/posts/views.py index abe325ae..a22b0b9d 100644 --- a/fet2020/posts/views.py +++ b/fet2020/posts/views.py @@ -43,7 +43,8 @@ def show(request,id=None): p=Post.objects.get(id=int(id)) elif id != ""and not id is None: p=Post.objects.get(slug=(id)) - return render(request, 'posts/show.html', {"post":p,"next":get_next_dict().get(p.slug,None)}) + similar_posts = p.tags.similar_objects() + return render(request, 'posts/show.html', {"post":p,"next":get_next_dict().get(p.slug,None), "related_posts": similar_posts}) # Ajax function that is called to calculate a slug from the title def slug_calc(request):