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