Commit ca6a7896 authored by Jan Ericsson Ong Ang's avatar Jan Ericsson Ong Ang

Updated models.py to include course object

parent 4ceb9a0f
from django.db import models from django.db import models
from assignments.models import Course
#Location Choices
location_choices = [ location_choices = [
('onsite', 'ONSITE'), ('onsite', 'ONSITE'),
('online', 'ONLINE'), ('online', 'ONLINE'),
('hybrid', 'HYBRID'), ('hybrid', 'HYBRID'),
] ]
# Location
# mode; venue;
class Location(models.Model): class Location(models.Model):
mode = models.CharField(max_length=50, choices = location_choices, default = 'onsite') mode = models.CharField(max_length=50, choices = location_choices, default = 'onsite')
venue = models.TextField(max_length=50) venue = models.TextField(max_length=50)
...@@ -16,14 +18,14 @@ class Location(models.Model): ...@@ -16,14 +18,14 @@ class Location(models.Model):
def __str__(self): def __str__(self):
return self.venue return self.venue
# Event
# target_datetime; activity; estimated_hours; location; course
class Event(models.Model): class Event(models.Model):
target_datetime = models.DateTimeField("Date and Time: ", max_length=50) target_datetime = models.DateTimeField("Date and Time: ", max_length=50)
activity = models.CharField("Activity: ",max_length=50) activity = models.CharField("Activity: ",max_length=50)
estimated_hours = models.FloatField("Estimated Hours: ",max_length=50) estimated_hours = models.FloatField("Estimated Hours: ",max_length=50)
location = models.ForeignKey(Location, on_delete=models.CASCADE) location = models.ForeignKey(Location, on_delete=models.CASCADE)
course = models.CharField("Course/Section: ",max_length=69, default="") #temporary: wait for the course from assignments app course = models.ForeignKey(Course, on_delete=models.CASCADE)
def __str__(self): def __str__(self):
return self.activity return self.activity
......
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