From 5d92e6fac7901c9829a759aec539e603dfb66038 Mon Sep 17 00:00:00 2001 From: adityacp Date: Tue, 26 Apr 2016 19:00:01 +0530 Subject: rebase changes --- yaksh/models.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'yaksh/models.py') 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 -- cgit