diff --git a/generic/models.py b/generic/models.py index 7d97a82f..2ab8e648 100644 --- a/generic/models.py +++ b/generic/models.py @@ -101,6 +101,16 @@ class ExamBase(models.Model): def get_question_index(self, question): return list(self.exam_questions.all()).index(question) + def get_authors(self): + """Returns a comma seperated text list of authors""" + authors = ", ".join([i.username for i in self.author.all()]) + return authors + + def get_author_objects(self): + """Returns a comma seperated text list of authors""" + authors = [i for i in self.author.all()] + return authors + class NoteType(models.Model): note_type = models.CharField(max_length=200)