diff options
author | adityacp | 2020-02-28 10:37:07 +0530 |
---|---|---|
committer | adityacp | 2020-02-28 10:37:07 +0530 |
commit | 78cc032340a8f0c8e0d456770783f2c894935c04 (patch) | |
tree | 3b6af04c555e86c99b7e8fa5a5442765402e9af3 /grades | |
parent | 0d189e0156741685e6f6f1c605bf99b44d082b0b (diff) | |
download | online_test-78cc032340a8f0c8e0d456770783f2c894935c04.tar.gz online_test-78cc032340a8f0c8e0d456770783f2c894935c04.tar.bz2 online_test-78cc032340a8f0c8e0d456770783f2c894935c04.zip |
Bump django to the latest version
Diffstat (limited to 'grades')
-rw-r--r-- | grades/models.py | 5 |
1 files changed, 3 insertions, 2 deletions
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) |