Commit 2a608fe1 authored by Michael Lopez's avatar Michael Lopez

edited views.py: created the necessary details to render page

parent f623ad47
......@@ -5,9 +5,9 @@
{% endblock %}
{% block content %}
<h1>{{object.title}}</h1> <br>
<h2> by {{object.author.first_name}} {{object.author.last_name}}</h2> <br>
{{pubpost.datetime}} <br> <br> <br>
<h2>{{object.title}}</h2> <br>
<h3> by {{object.author.first_name}} {{object.author.last_name}}</h3> <br>
<p>{{pubpost.datetime}}</p> <br> <br> <br>
<li>{{object.body}}</li>
<br><br>
......@@ -18,7 +18,4 @@ Angry: {{angry_count}}
<form action='edit'>
<input type="submit" value="Edit Announcement"/>
</form>
{% endblock %}
{% endblock %}
\ No newline at end of file
from django.urls import path
from .views import AnnouncementDetailView
from .views import pageview
urlpatterns = [
......
import pytz
import pytz # need to do "pip install pytz" for this to be activated
from .models import Announcement, Reaction
from django.utils import timezone
from django.views.generic import ListView, DetailView
from django.db.models import Sum
from django.shortcuts import render
def pageview(request):
model_object = Announcement.objects.order_by("-pub_datetime")
return render(request, "announcement.html", context={"announcement_list":model_object})
def UTC_to_PHTZ(utctime):
ph_tz = "%m/%d/%Y, %I:%M %p"
......@@ -29,3 +35,4 @@ class AnnouncementDetailView(DetailView):
context['pubpost_datetime'] = UTC_to_PHTZ(announcement.pub_datetime)
return context
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