Commit e372e982 authored by Angelo Alvarez's avatar Angelo Alvarez

Added specified models to Calendar app

parent fd90c34d
from django.db import models from django.db import models
from assignments.models import Course
# Create your models here. # Create your models here.
class Location(models.Model):
LOCATION_CHOICES = [
('ONSITE', 'Onsite'),
('ONLINE', 'Online'),
('HYBRID', 'Hybrid'),
]
mode = models.CharField(max_length=6, choices=LOCATION_CHOICES, default='ONSITE')
venue = models.CharField(max_length=50)
def __str__(self):
return self.venue
class Event(models.Model):
target_datetime = models.DateTimeField()
activity = models.CharField(max_length=50)
estimated_hours = models.FloatField()
location = models.ForeignKey(Location, on_delete=models.CASCADE)
course = models.ForeignKey(Course, on_delete=models.CASCADE)
def __str__(self):
return self.activity
from django.shortcuts import render from django.shortcuts import render
from django.db import models
from assignments.models import Course
# Create your views here. # Create your views here.
class Event(models.Model):
target_datetime = models.DateTimeField()
activity = models.CharField(max_length=50)
estimated_hours = models.FloatField()
location = models.CharField(max_length=50)
course = models.ForeignKey(Course, on_delete=models.CASCADE)
\ 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