Commit 9da66da9 authored by Ysabella Panghulan's avatar Ysabella Panghulan

added calendar app in installed apps

parent 343b66e4
...@@ -5,15 +5,15 @@ from .models import Location, Event ...@@ -5,15 +5,15 @@ from .models import Location, Event
# Create your views here. # Create your views here.
def index(request): def index(request):
events = Event.objects.all() events = Event.objects.all()
welcomeMessage = 'Widget’s Calendar of Activities <br><br>' welcomeMessage = 'Widget\’s Calendar of Activities <br><br>'
activities = '' activities = ''
for event in events: for event in events:
activities += 'Date and Time: ' + event.target_datetime.strftime('%m/%d/%Y, %I:%M%p') + '<br>' 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 += '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 += 'Mode: ' + event.location.mode + '<br>'
activities += 'Venue: ' + event.location.venue + '<br>' activities += 'Venue: ' + event.location.venue + '<br><br>'
return HttpResponse(welcomeMessage + activities) return HttpResponse(welcomeMessage + activities)
\ No newline at end of file
...@@ -35,6 +35,7 @@ ALLOWED_HOSTS = [] ...@@ -35,6 +35,7 @@ ALLOWED_HOSTS = []
# Application definition # Application definition
INSTALLED_APPS = [ INSTALLED_APPS = [
'widget_calendar.apps.WidgetCalendarConfig',
'django.contrib.admin', 'django.contrib.admin',
'django.contrib.auth', 'django.contrib.auth',
'django.contrib.contenttypes', 'django.contrib.contenttypes',
......
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