Commit 1e41567f authored by Alvin Joshua Andrada's avatar Alvin Joshua Andrada

fixed datetime formats and updated references

parent a536d1db
......@@ -22,7 +22,13 @@ Fausto - Dashboard App
This project was accomplished truthfully only by the people whose names are listed above.
(lol di ko alam please check - alvin)
# list of references used; and
# list of references used;
Queries - Django Documentation
https://docs.djangoproject.com/en/4.1/topics/db/queries/#retrieving-a-single-object-with-get
Datetime Import
https://docs.python.org/3/library/datetime.html
# members’ signatures in the form (sgd) your complete name, date
John Michael T. Amador (sgd) February 28, 2023
......
#Reference: Queries - Django Documentation
# https://docs.djangoproject.com/en/4.1/topics/db/queries/#retrieving-a-single-object-with-get
#References:
# Queries - Django Documentation
# https://docs.djangoproject.com/en/4.1/topics/db/queries/#retrieving-a-single-object-with-get
# Datetime Import
# https://docs.python.org/3/library/datetime.html
from django.shortcuts import render
from django.http import HttpResponse
from .models import Event, Location
import datetime
def index(request):
total_objects = Event.objects.count()
......@@ -17,7 +22,8 @@ def index(request):
def display_details(index):
#gets all the object's attributes
event = Event.objects.get(pk=index)
date_time = event.target_datetime
date = event.target_datetime.date().strftime("%m/%d/%Y")
time = event.target_datetime.time().strftime("%I:%M %p")
activity = event.activity
estimated_hours = event.estimated_hours
# course_code = event.course.code
......@@ -27,7 +33,7 @@ def display_details(index):
venue = event.location.venue
#arrange all the details
display = 'Date and Time: {} <br>'.format(date_time)
display = 'Date and Time: {}, {} <br>'.format(date,time)
display += 'Activity: {} <br>'.format(activity)
display += 'Estimated Hours {} <br>'.format(estimated_hours)
display += 'Course/Section: {} {}-{} <br>' #.format(course_code,course_title,section)
......
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