Changed course to foreignkey

parent 55423141
from django.db import models from django.db import models
from widget_vincentdjango.assignments.models import Course
from datetime import datetime from datetime import datetime
...@@ -14,7 +15,11 @@ class Event(models.Model): ...@@ -14,7 +15,11 @@ class Event(models.Model):
target_datetime = models.DateTimeField(default=datetime.now()) target_datetime = models.DateTimeField(default=datetime.now())
activity = models.CharField(max_length=100, default="") activity = models.CharField(max_length=100, default="")
estimated_hours = models.FloatField(default=0) estimated_hours = models.FloatField(default=0)
course = models.CharField(max_length=100, default="") course = models.ForeignKey(
Course,
on_delete=models.CASCADE,
related_name='Section'
)
location = models.ForeignKey( location = models.ForeignKey(
Location, Location,
on_delete=models.CASCADE, on_delete=models.CASCADE,
......
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