Renamed forumpost field in replys to forum_post to follow the specifications...

Renamed forumpost field in replys to forum_post to follow the specifications and cleaned up the code formatting to fit the style guide
parent 82b92164
......@@ -10,14 +10,20 @@ def pageview(request):
for announcement in announcements:
string_builder = "{} <br> {} by {} published {} <br> {}".format(
string_builder, announcement.title, announcement.author,
string_builder,
announcement.title,
announcement.author,
announcement.pub_datetime.strftime("%m/%d/%Y, %I:%M %p:"),
announcement.body
)
for reaction in reactions:
if reaction.announcement == announcement:
string_builder = "{} <br> {}: {}".format(string_builder, reaction.name, reaction.tally)
string_builder = "{} <br> {}: {}".format(
string_builder,
reaction.name,
reaction.tally
)
string_builder += "<br>"
......
<p>
{{"Widget's Assignments Page"}}<br><br>
</p>
<p>{{"Widget's Assignments Page"}}<br><br></p>
{% for data in assignment %}
<p>
Assignment name: {{data.name}}<br>
......
......@@ -8,9 +8,7 @@ class ForumPostAdmin(admin.ModelAdmin):
class ReplyAdmin(admin.ModelAdmin):
model = Reply
list_display = ["body", "author", "forumpost"]
list_display = ["body", "author", "forum_post"]
admin.site.register(ForumPost, ForumPostAdmin)
admin.site.register(Reply, ReplyAdmin)
\ No newline at end of file
# Register your models here.
\ No newline at end of file
# Generated by Django 4.1.6 on 2023-03-06 09:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('forum', '0001_initial'),
]
operations = [
migrations.RenameField(
model_name='reply',
old_name='forumpost',
new_name='forum_post',
),
]
......@@ -14,9 +14,7 @@ class Reply(models.Model):
body = models.TextField()
author = models.ForeignKey(WidgetUser, on_delete=models.CASCADE)
pub_datetime = models.DateTimeField()
forumpost = models.ForeignKey(ForumPost, on_delete=models.CASCADE)
forum_post = models.ForeignKey(ForumPost, on_delete=models.CASCADE)
def __str__(self):
return self.body
# Create your models here.
......@@ -11,15 +11,20 @@ def pageview(request):
for forumpost in forumposts:
string_builder = "{} <br> {} by {} posted {} <br> {}".format(
string_builder, forumpost.title, forumpost.author,
forumpost.pub_datetime.strftime("%m/%d/%Y, %I:%M %p:"), forumpost.body
string_builder,
forumpost.title,
forumpost.author,
forumpost.pub_datetime.strftime("%m/%d/%Y, %I:%M %p:"),
forumpost.body
)
for reply in replys:
if reply.forumpost == forumpost:
if reply.forum_post == forumpost:
string_builder = "{} <br> Reply by {} posted {} <br> {}".format(
string_builder, reply.author,
reply.pub_datetime.strftime("%m/%d/%Y, %I:%M %p:"), reply.body
string_builder,
reply.author,
reply.pub_datetime.strftime("%m/%d/%Y, %I:%M %p:"),
reply.body
)
string_builder += "<br>"
......
<p>Widget's Calendar of Activities<br /><br /></p>
<p>Widget's Calendar of Activities<br><br></p>
{% for event in events %}
<p>
{{ event.target_datetime }}<br />
Activity: {{ event.activity }}<br />
Estimated Hours: {{ event.estimated_hours }}<br />
Course/Section: {{ event.course }}<br />
Mode: {{ event.location.mode }}<br />
{{ event.target_datetime }}<br>
Activity: {{ event.activity }}<br>
Estimated Hours: {{ event.estimated_hours }}<br>
Course/Section: {{ event.course }}<br>
Mode: {{ event.location.mode }}<br>
Venue: {{ event.location.venue }}
</p>
{% endfor %}
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