From 77d2154ca2c46271e8611b36d70822c2b09c36ad Mon Sep 17 00:00:00 2001 From: Sanj Date: Fri, 21 Oct 2011 02:50:01 +0100 Subject: [PATCH] bestpractices faq --- itf/bestpractices/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/itf/bestpractices/models.py b/itf/bestpractices/models.py index 5af9faf..f3e2917 100755 --- a/itf/bestpractices/models.py +++ b/itf/bestpractices/models.py @@ -118,6 +118,8 @@ class BestPracticeFAQ(ItfModel): question = models.TextField() answer = models.TextField() + title_field = 'question' + def __unicode__(self): return self.question @@ -128,7 +130,14 @@ class BestPracticeFAQ(ItfModel): 'answer': self.answer, } + def info_dict(self): + return { + 'id': self.id, + 'question': self.question, + 'answer': self.answer + } + class BestPracticeCategory(models.Model): name = models.CharField(max_length=256) description = models.TextField(blank=True)