From a80d465ad010cfa62f3b0468a5d69e8fef477536 Mon Sep 17 00:00:00 2001 From: Sanj Date: Mon, 24 Oct 2011 00:09:55 +0100 Subject: [PATCH] glossary stuff --- itf/bestpractices/models.py | 6 +++++- itf/insidepages/models.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/itf/bestpractices/models.py b/itf/bestpractices/models.py index 704adc8..3cee91a 100755 --- a/itf/bestpractices/models.py +++ b/itf/bestpractices/models.py @@ -216,9 +216,10 @@ class Guideline(ItfModel): return self.title -class Glossary(models.Model): +class Glossary(ItfModel): term = models.CharField(max_length=256) definition = models.TextField() + title_field = 'term' def get_dict(self): return { @@ -233,6 +234,9 @@ class Glossary(models.Model): 'definition': self.definition } + def info_dict(self): + return self.list_dict() + def __unicode__(self): return self.term diff --git a/itf/insidepages/models.py b/itf/insidepages/models.py index 9fa94a8..e5691d5 100755 --- a/itf/insidepages/models.py +++ b/itf/insidepages/models.py @@ -18,7 +18,7 @@ class ModuleTab(models.Model): module = models.ForeignKey(Module) title = models.CharField(max_length=64, help_text="Display title for tab") slug = models.SlugField(help_text="short name for tab, to be used in url, eg. faq") - text = models.TextField(help_text="text to show up in LHS for tab") + text = models.TextField(help_text="text to show up in LHS for tab", blank=True) model = models.ForeignKey("ModelExtra", help_text="Database model object tab is linked to (chose from list or ask for one to be created.)") is_default = models.BooleanField(default=False, help_text="Whether this should be the default displayed tab.") order = models.IntegerField(default=1, help_text="Make number higher to send it lower in order (default will always show first)")