Adjusted Views

parent 61d7bd65
...@@ -10,15 +10,15 @@ from .forms import ForumPostForm ...@@ -10,15 +10,15 @@ from .forms import ForumPostForm
def ForumViews(request): def ForumViews(request):
forum = ForumPost.objects.all() forum = ForumPost.objects.all()
context = {'forum':forum} context = {'forum':forum}
return render(request, 'forum.html', context) return render(request, 'forum/forum.html', context)
class ForumPostDetails(DetailView): class ForumPostDetails(DetailView):
template_name= "forumpost-details.html" template_name= "forum/forumpost-details.html"
model = ForumPost model = ForumPost
class ForumPostNew(CreateView): class ForumPostNew(CreateView):
form_class = ForumPostForm form_class = ForumPostForm
template_name = "forumpost-add.html" template_name = "forum/forumpost-add.html"
def get_success(self): def get_success(self):
return reverse('forum:forumpostnew', kwargs = {'pk': self.object.id}, return reverse('forum:forumpostnew', kwargs = {'pk': self.object.id},
...@@ -26,7 +26,7 @@ class ForumPostNew(CreateView): ...@@ -26,7 +26,7 @@ class ForumPostNew(CreateView):
class ForumPostEdit(UpdateView): class ForumPostEdit(UpdateView):
form_class = ForumPostForm form_class = ForumPostForm
template_name = "forumpost-edit.html" template_name = "forum/forumpost-edit.html"
queryset = ForumPost.objects.all() queryset = ForumPost.objects.all()
def get_success_url(self): def get_success_url(self):
......
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