Made and applied migrations

parent 7f30c066
# Generated by Django 4.0.3 on 2022-04-06 02:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('announcements', '0006_remove_announcement_reaction_reaction_announcement'),
]
operations = [
migrations.RemoveField(
model_name='reaction',
name='tally',
),
migrations.AddField(
model_name='reaction',
name='id',
field=models.BigAutoField(auto_created=True, default=1, primary_key=True, serialize=False, verbose_name='ID'),
preserve_default=False,
),
]
...@@ -16,12 +16,12 @@ def announcements(request): ...@@ -16,12 +16,12 @@ def announcements(request):
for i in all_announcements: for i in all_announcements:
title = i.announcement_title title = i.announcement_title
body = i.announcement_body body = i.announcement_body
date = i.pub_date date = str(i.pub_date)
last_name = i.author.last_name last_name = i.author.last_name
first_name = i.author.first_name first_name = i.author.first_name
like_tally = Reaction.objects.filter(reaction_name='Like', announcement=i).count() like_tally = str(Reaction.objects.filter(reaction_name='Like', announcement=i).count())
love_tally = Reaction.objects.filter(reaction_name='Love', announcement=i).count() love_tally = str(Reaction.objects.filter(reaction_name='Love', announcement=i).count())
angry_tally = Reaction.objects.filter(reaction_name='Angry', announcement=i).count() angry_tally = str(Reaction.objects.filter(reaction_name='Angry', announcement=i).count())
output = (title+' by '+first_name+' '+last_name+' dated '+date+':<br>' output = (title+' by '+first_name+' '+last_name+' dated '+date+':<br>'
+body+'<br>' +body+'<br>'
......
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