Commit 1eb7d824 authored by Norberto Tadeo's avatar Norberto Tadeo 😔

changed some lines in views.py for better readability

parent b4cd0ab1
# Generated by Django 4.0.3 on 2022-04-05 15:38
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0006_widgetuser_department'),
('forum', '0005_reply_author'),
]
operations = [
migrations.AlterField(
model_name='post',
name='author',
field=models.ForeignKey(default='Anonymous', null=True, on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'),
),
migrations.AlterField(
model_name='reply',
name='author',
field=models.ForeignKey(default='Anonymous', null=True, on_delete=django.db.models.deletion.CASCADE, to='homepage.widgetuser'),
),
]
......@@ -13,8 +13,8 @@ def displayForumPosts(request):
P_body = Post.post_body
P_pub_date = Post.pub_date
PostThread = ("<br><font size='+1'> Post (" + P_title + ") by " + str(Post.author) + " dated " + str(P_pub_date) + ": <br>" + P_body + "</font>")
output += PostThread + "<br>"
PostThread = ("<br><font size='+1.5'> '<b>" + P_title + "</b>' by <i>" + str(Post.author.first_name) + " " + str(Post.author.last_name) + "</i> dated " + str(P_pub_date) + ": <br>" + P_body + "</font>")
output += PostThread + ""
for Reply in ForumReplies:
ReplytoPost = Reply.post.post_title
......@@ -23,7 +23,8 @@ def displayForumPosts(request):
if ReplytoPost == P_title and R_body != NULL:
ReplyThread = (
"<br> Reply to (" + ReplytoPost + ") by " + str(Reply.author) + " dated " + str(R_pub_date) + ": <br>" +
"<br> Reply by <i>" + str(Reply.author.first_name) + " " + str(Reply.author.last_name) + "</i> dated " + str(R_pub_date) + ": <br>" +
R_body )
output += ReplyThread + "<br>"
output += ReplyThread + ""
output += "<br>"
return HttpResponse('<h1>FORUM POSTS: </h1>' + output )
\ 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