Commit 10927d16 authored by Caryn Lopez-Go's avatar Caryn Lopez-Go

changed passing_score into @property

parent 6ff1e35f
...@@ -14,8 +14,10 @@ class Assignment(models.Model): ...@@ -14,8 +14,10 @@ class Assignment(models.Model):
description = models.TextField(max_length=500) description = models.TextField(max_length=500)
course = models.ForeignKey(Course, on_delete=models.CASCADE) course = models.ForeignKey(Course, on_delete=models.CASCADE)
perfect_score = models.IntegerField(default=0) perfect_score = models.IntegerField(default=0)
passing = round(perfect_score*0.6)
passing_score = models.IntegerField(default=passing) @property
def passing_score(self):
return round(self.perfect_score*0.6)
def __str__(self): def __str__(self):
return self.name return self.name
\ 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