Commit fa94d592 authored by Bianca Aguilar's avatar Bianca Aguilar

Edited Forum view so that it could allow multiple replies

parent 24e86a9b
......@@ -3,6 +3,10 @@
+ Homepage (Lab 1)
+ Forum (Lab 1)
+ Forum Models (Lab 2)
+ Forum Models (Midterm)
+ Forum View (Midterm)
+ Announcements Models (Midterm)
+ Announcements View (Midterm)
**Alissandra Tanaliga:**
+ Announcements (Lab 1)
......
No preview for this file type
......@@ -8,10 +8,10 @@ def index(request):
final_list = ''
for p in range(len(Post.objects.all())):
final_list += '{}'.format(Post.objects.get(pk=p+1).post_detail)
reply_list = list(Reply.objects.filter(post=Post.objects.get(pk=p+1)))
reply_list = list(Reply.objects.filter(post__exact=Post.objects.get(pk=p+1)))
for r in range(len(reply_list)):
final_list += '{}'.format(Reply.objects.get(post__exact=Post.objects.get(pk=p+1)).reply_detail)
final_list += '{}'.format(reply_list[r].reply_detail)
final_list += '<br>'
return final_list
......
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