Commit 1afde53b authored by Jayson Lim's avatar Jayson Lim

updated view for announcement board posts

parent 68d03b5a
# Generated by Django 3.2 on 2023-03-05 11:15
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('announcementBoard', '0002_auto_20230305_1528'),
('announcementBoard', '0002_auto_20230305_1746'),
]
operations = [
]
......@@ -18,7 +18,7 @@ class Announcement(models.Model):
return self.title
def format_pub_datetime(self):
return self.pub_datetime.strftime('%m/%d/%Y %I:%M %p')
return self.pub_datetime.strftime('%m/%d/%Y, %I:%M %p')
class Reaction(models.Model):
name = models.CharField(max_length=5, choices=[('Like', 'Like'),
......
......@@ -18,10 +18,10 @@ def index(request):
body += "<p style='border: 2px solid gray;\
border-radius:5px;\
padding:20px 30px;'>\
{} by {} published {}:\
{} by {} {} published {}:\
<br>\
{}\
</p>".format(x.title, x.author,
</p>".format(x.title, x.author.first_name, x.author.last_name,
x.format_pub_datetime(), x.body)
for y in reaction:
body += "<p>{}: {}\
......
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