From 78cc032340a8f0c8e0d456770783f2c894935c04 Mon Sep 17 00:00:00 2001 From: adityacp Date: Fri, 28 Feb 2020 10:37:07 +0530 Subject: Bump django to the latest version --- grades/models.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'grades') diff --git a/grades/models.py b/grades/models.py index b395a24..656c0d1 100644 --- a/grades/models.py +++ b/grades/models.py @@ -5,7 +5,8 @@ from django.contrib.auth.models import User class GradingSystem(models.Model): name = models.CharField(max_length=255, unique=True) description = models.TextField(default='About the grading system!') - creator = models.ForeignKey(User, null=True, blank=True) + creator = models.ForeignKey(User, null=True, blank=True, + on_delete=models.CASCADE) def get_grade(self, marks): ranges = self.graderange_set.all() @@ -39,7 +40,7 @@ class GradingSystem(models.Model): class GradeRange(models.Model): - system = models.ForeignKey(GradingSystem) + system = models.ForeignKey(GradingSystem, on_delete=models.CASCADE) lower_limit = models.FloatField() upper_limit = models.FloatField() grade = models.CharField(max_length=10) -- cgit