Commit 75f0f593 authored by Ysabella Panghulan's avatar Ysabella Panghulan

added Event and Location models in calendar app

parent 907cf36e
from django.db import models from django.db import models
# 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 = 10, choices = LOCATION_CHOICES)
venue = models.TextField(null = True, blank = True)
def __str__(self):
return self.venue
class Event(models.Model):
target_datetime = models.DateTimeField('target date')
activity = models.TextField()
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
\ 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