Commit 99b7dab8 authored by Migs Atienza's avatar Migs Atienza

Fixed errors in forumpost-details.html

parent 06477dce
SECRET_KEY = 'django-insecure-0ne3r+4_-4wxim9e1!jkyw8%fnii1af4pc$irxf%nvrs3wp*1f'
\ No newline at end of file
No preview for this file type
......@@ -2,19 +2,21 @@
{% block title %}{{ reply.forum_post.title }}{% endblock %}
{% block content %}
<h1>{{ reply.forum_post.title }}</h1>
<h3>by {{ reply.forum_post.author }}<br>
{{ reply.forum_post.pub_datetime }}<br>
{{ reply.forum_post.body }}<br>
<h1>{{ forum_post.title }}</h1>
<h3>by {{ forum_post.author }}<br>
{{ forum_post.pub_datetime }}<br>
{{ forum_post.body }}<br>
</h3>
<br>
<h1>POST REPLIES</h1>
<h3>
by {{ reply.author }}
{{ reply.pub_datetime }}
{{ reply.body }}
{% for reply in forum_post.reply_set.all %}
by {{ reply.author }}
{{ reply.pub_datetime }}
{{ reply.body }}
{% endfor %}
</h3>
{% endblock %}
{% block scripts %}
<a href="/forum/forumposts/{{ reply.forum_post.pk }}/edit"><input type="submit" value="Edit Post"></a>
<a href="/forum/forumposts/{{ forum_post.pk }}/edit"><input type="submit" value="Edit Post"></a>
{% endblock %}
\ No newline at end of file
......@@ -11,10 +11,10 @@ def index(request):
class ForumPostDetailView(DetailView):
model = Reply
model = ForumPost
def get(self, request, pk):
return render(request, 'forum/forumpost-details.html', {'reply': self.model.objects.get(pk=pk)})
return render(request, 'forum/forumpost-details.html', {'forum_post': self.model.objects.get(pk=pk)})
class ForumPostCreateView(CreateView):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment