change __str__ method of models

parent 5632829f
...@@ -20,8 +20,14 @@ class Assignment(models.Model): ...@@ -20,8 +20,14 @@ class Assignment(models.Model):
null=True, null=True,
) )
def __str__(self):
return self.name
class Course(models.Model): class Course(models.Model):
code = models.CharField(max_length=10) code = models.CharField(max_length=10)
title = models.CharField(max_length=120) title = models.CharField(max_length=120)
section = models.CharField(max_length=3) section = models.CharField(max_length=3)
def __str__(self):
return self.code + " " + self.title + " " + self.section
\ 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