diff options
author | Tomasz Zielinski <tomasz.zielinski@pyconsultant.eu> | 2011-12-07 15:05:11 +0100 |
---|---|---|
committer | Tomasz Zielinski <tomasz.zielinski@pyconsultant.eu> | 2011-12-07 15:05:11 +0100 |
commit | 111f6ee84f801777a6ce052f4e911127a8ecb8eb (patch) | |
tree | 41ebc73767715363aa0b9716bbb7cf7ac513bd86 | |
parent | 4cc0902d7006f5d90cd1bb30843dfa29776c7524 (diff) | |
download | askbot-111f6ee84f801777a6ce052f4e911127a8ecb8eb.tar.gz askbot-111f6ee84f801777a6ce052f4e911127a8ecb8eb.tar.bz2 askbot-111f6ee84f801777a6ce052f4e911127a8ecb8eb.zip |
Tickets 104, 107: transplant of slug
-rw-r--r-- | askbot/models/content.py | 5 | ||||
-rw-r--r-- | 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 |