Commit 1ebdde8c authored by Ysabella Panghulan's avatar Ysabella Panghulan

fixed format in views

parent 603680f0
......@@ -5,15 +5,15 @@ from .models import Location, Event
# Create your views here.
def index(request):
events = Event.objects.all()
welcomeMessage = 'Widget’s Calendar of Activities <br><br>'
welcomeMessage = 'Widget’\s Calendar of Activities <br><br>'
activities = ''
for event in events:
activities += 'Date and Time: ' + event.target_datetime.strftime('%m/%d/%Y, %I:%M%p') + '<br>'
activities += 'Activity: '+ event.activity + '</br>'
activities += 'Activity: '+ event.activity + '<br>'
activities += 'Estimated Hours: ' + str(event.estimated_hours) + '<br>'
activities += 'Course/Section: ' + event.course.title + '<br>'
activities += 'Course/Section: ' + event.course.code + ' ' + event.course.title + '-' + event.course.section + '<br>'
activities += 'Mode: ' + event.location.mode + '<br>'
activities += 'Venue: ' + event.location.venue + '<br>'
activities += 'Venue: ' + event.location.venue + '<br><br>'
return HttpResponse(welcomeMessage + activities)
\ No newline at end of file
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