Commit fe94ab32 authored by iceman2434's avatar iceman2434

Added backup code

if the __str__ model for posts and replies won't work, replace the forum function
parent ac190421
...@@ -17,3 +17,17 @@ def forum(request): ...@@ -17,3 +17,17 @@ def forum(request):
reply = Reply.objects.all() reply = Reply.objects.all()
output = "FORUM POSTS:<br>" + "<br>".join([str(x) for x in post]) + "<br>".join([str(z) for z in reply]) output = "FORUM POSTS:<br>" + "<br>".join([str(x) for x in post]) + "<br>".join([str(z) for z in reply])
return HttpResponse(output, content_type="text/plain") return HttpResponse(output, content_type="text/plain")
# def forum(request):
# post = Post.objects.all()
# reply = Reply.objects.all()
# posts = ""
# replies = ""
# for x in post:
# posts += '<br>{} by {} dated {}:<br> {}'.format(x.post_title, x.author.full_name(), x.pub_date, x.post_body)
# for y in reply:
# replies += '<br>Reply by {} dated {}:<br> {}'.format(y.author.full_name(), y.pub_date, y.reply_body)
# output = "FORUM POSTS:" + posts + replies
# return HttpResponse(output, content_type="text/plain")
\ No newline at end of file
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