summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--askbot/models/content.py5
-rw-r--r--askbot/models/question.py4
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