Commit e1c079fa authored by Nate Brevin A. Que's avatar Nate Brevin A. Que

Added __str__ functions to the models.

parent a33d1373
......@@ -6,10 +6,16 @@ class Course(models.Model):
title = models.CharField(max_length=100)
section = models.CharField(max_length=3)
def __str__(self):
return '{} {}-{}'.format(self.code, self.title, self.section)
class Assignment(models.Model):
name = models.CharField(max_length=100)
description = models.TextField()
course = models.ForeignKey(Course, on_delete=models.CASCADE)
perfect_score = models.IntegerField()
passing_score = models.IntegerField()
\ No newline at end of file
passing_score = models.IntegerField()
def __str__(self):
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