diff options
Diffstat (limited to 'forum/managers.py')
-rw-r--r-- | forum/managers.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/forum/managers.py b/forum/managers.py index 2e3e4186..314f022f 100644 --- a/forum/managers.py +++ b/forum/managers.py @@ -18,6 +18,10 @@ class QuestionManager(models.Manager): def get_questions_by_tag(self, tagname, orderby): questions = self.filter(deleted=False, tags__name = unquote(tagname)).order_by(orderby) return questions + + def get_questions_by_category(self, categoryname, orderby): + questions = self.filter(category__name = categoryname).order_by(orderby) + return questions def get_unanswered_questions(self, orderby): questions = self.filter(deleted=False, answer_count=0).order_by(orderby) |