Commit 312176d1 authored by Jose Gabriel L. Salas's avatar Jose Gabriel L. Salas

fixed views.py formatting

parent d913f342
...@@ -4,21 +4,20 @@ from .models import Event, Location ...@@ -4,21 +4,20 @@ from .models import Event, Location
def index(request): def index(request):
return_string = "<p>Widget's Calendar of Activities</p> <ul style='list-style: none; padding: 0; margin: 0;'> " return_string = "<p>Widget's Calendar of Activities</p>"
for events in Event.objects.all(): for events in Event.objects.all():
round_hours = ("{:0.0f}".format(events.estimated_hours)) round_hours = ("{:0.0f}".format(events.estimated_hours))
return_string += '<li>Date and Time: {}<br>'.format( return_string += 'Date and Time: {}<br>'.format(
events.target_datetime.strftime('%m/%d/%Y, %H:%M %p') events.target_datetime.strftime('%m/%d/%Y, %H:%M %p')
) )
return_string += 'Activity: {}<br>'.format(events.activity) return_string += 'Activity: {}<br>'.format(events.activity)
return_string += 'Estimated Hours: {}<br>'.format(round_hours) return_string += 'Estimated Hours: {}<br>'.format(round_hours)
return_string += 'Course/Section: {}<br>'.format(events.course) return_string += 'Course/Section: {}<br>'.format(events.course)
return_string += 'Mode: {}<br>'.format(events.location.mode) return_string += 'Mode: {}<br>'.format(events.location.mode)
return_string += 'Venue: {}<br></li>'.format(events.location.venue) return_string += 'Venue: {}<br>'.format(events.location.venue)
return_string += '<br>' return_string += '<br>'
return_string += '</ul>'
html_string = '<html><body>{}</body></html>'.format(return_string) html_string = '<html><body>{}</body></html>'.format(return_string)
return HttpResponse(html_string) return HttpResponse(html_string)
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