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

fixed views.py formatting

parent d913f342
......@@ -9,16 +9,16 @@ class EventAdmin(admin.ModelAdmin):
list_display = (
'target_datetime', 'activity', 'estimated_hours',
'location', 'course',
)
)
list_filter = ('target_datetime', 'course', )
fieldsets = [
('Activity', {
'fields': [
('activity', 'course', ),
'target_datetime', 'location', 'estimated_hours'
]
}),
]
]
}),
]
class LocationAdmin(admin.ModelAdmin):
......
......@@ -12,7 +12,7 @@ class Location(models.Model):
]
mode = models.CharField(
max_length=6, choices=mode_choices, default=onsite,
)
)
venue = models.CharField(max_length=100)
def __str__(self):
......
......@@ -4,21 +4,20 @@ from .models import Event, Location
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():
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')
)
)
return_string += 'Activity: {}<br>'.format(events.activity)
return_string += 'Estimated Hours: {}<br>'.format(round_hours)
return_string += 'Course/Section: {}<br>'.format(events.course)
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 += '</ul>'
html_string = '<html><body>{}</body></html>'.format(return_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