From 111f6ee84f801777a6ce052f4e911127a8ecb8eb Mon Sep 17 00:00:00 2001 From: Tomasz Zielinski Date: Wed, 7 Dec 2011 15:05:11 +0100 Subject: Tickets 104, 107: transplant of slug --- askbot/models/content.py | 5 +++++ askbot/models/question.py | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/askbot/models/content.py b/askbot/models/content.py index 22ae4446..45aa23be 100644 --- a/askbot/models/content.py +++ b/askbot/models/content.py @@ -105,6 +105,11 @@ class Content(models.Model): #hit the database to trigger update of full text search vector self.question.save() + def _get_slug(self): + if not self.is_question(): + raise NotImplementedError + return slugify(self.thread.title) + slug = property(_get_slug) def get_comments(self, visitor = None): """returns comments for a post, annotated with diff --git a/askbot/models/question.py b/askbot/models/question.py index 3284ee45..589b723d 100644 --- a/askbot/models/question.py +++ b/askbot/models/question.py @@ -736,10 +736,6 @@ class Question(content.Content): class Meta(content.Content.Meta): db_table = u'question' - def _get_slug(self): - return slugify(self.thread.title) - - slug = property(_get_slug) if getattr(settings, 'USE_SPHINX_SEARCH', False): from djangosphinx.models import SphinxSearch -- cgit v1.2.3-1-g7c22