Commit 3c204a86 authored by Angelo Alvarez's avatar Angelo Alvarez

Fixed format of dropdown choices in Forms

parent ee2a8d9e
......@@ -7,7 +7,7 @@ class Course(models.Model):
section = models.CharField(max_length=3)
def __str__(self):
return self.code
return self.code + " " + self.title + " - " + self.section
class Assignment(models.Model):
......
......@@ -14,6 +14,9 @@ class Location(models.Model):
venue = models.TextField(max_length=255)
def __str__(self):
return self.mode + " - " + self.venue.replace('\r\n', ' or ')
def getvenue(self):
return self.venue.replace('\r\n', ' or ')
......
......@@ -6,9 +6,9 @@
<h1>{{ object.activity }}</h1>
<b>Date and Time: </b> {{ object.target_datetime|date:"m/d/Y, h:i A" }} <br>
<b>Estimated Hours: </b>{{ object.estimated_hours }} <br>
<b>Course: </b>{{ object.course.code }} {{ object.course.title }} - {{ object.course.section }} <br>
<b>Course: </b>{{ object.course }} <br>
<b>Mode: </b>{{ object.location.mode }} <br>
<b>Venue: </b>{{ object.location|urlize }} <br>
<b>Venue: </b>{{ object.location.getvenue|urlize }} <br>
<form action="../edit">
<button type="Submit">Edit Activity</button>
......
from django.shortcuts import render
from django.http import HttpResponse
from .models import Event
from django import forms
from django.utils import timezone
from django.views.generic.detail import DetailView
from django.views.generic.edit import CreateView, UpdateView
......@@ -25,4 +26,4 @@ class EventCreateView(CreateView):
class EventUpdateView(UpdateView):
template_name = 'calendar_app/event-edit.html'
model = Event
fields = ['activity', 'target_datetime', 'estimated_hours', 'location', 'course']
fields = ['activity', 'target_datetime', 'estimated_hours', 'location', 'course']
\ 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