diff options
Diffstat (limited to 'yaksh/models.py')
-rw-r--r-- | yaksh/models.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/yaksh/models.py b/yaksh/models.py index 9b92791..65b4dc0 100644 --- a/yaksh/models.py +++ b/yaksh/models.py @@ -71,6 +71,8 @@ class Course(models.Model): requests = models.ManyToManyField(User, related_name='requests') rejected = models.ManyToManyField(User, related_name='rejected') created_on = models.DateTimeField(auto_now_add=True) + teachers = models.ManyToManyField(User, related_name='teachers') + def request(self, *users): self.requests.add(*users) @@ -116,6 +118,9 @@ class Course(models.Model): def deactivate(self): self.active = False + def add_teachers(self, *users): + self.teachers.add(*users) + def __unicode__(self): return self.name |