Skip to content

Commit

Permalink
Use actual keyword instances in blog listing. Closes stephenmcd#431.
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenmcd committed Oct 13, 2012
1 parent 831d813 commit ec8d81c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion mezzanine/blog/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ def category_list(self):
return getattr(self, "_categories", self.categories.all())

def keyword_list(self):
return getattr(self, "_keywords", self.keywords.all())
try:
return self._keywords
except AttributeError:
keywords = [k.keyword for k in self.keywords.all()]
setattr(self, "_keywords", keywords)
return self._keywords


class BlogCategory(Slugged):
Expand Down

0 comments on commit ec8d81c

Please sign in to comment.