diff --git a/polls/models.py b/polls/models.py index 791b85b..78adb50 100644 --- a/polls/models.py +++ b/polls/models.py @@ -223,6 +223,10 @@ class Question(models.Model): return score + def get_tags(self, *args, **kwargs): + return "-".join([tag.tag_text for tag in self.tags.all()]) + + def save(self, *args, **kwargs): """Modify save method of Question object""" # to-be-added instance # * https://github.com/django/django/blob/866122690dbe233c054d06f6afbc2f3cc6aea2f2/django/db/models/base.py#L447 @@ -233,9 +237,6 @@ class Question(models.Model): self.trend_score = self.trending_score(up=0, down=0) super(Question, self).save(*args, **kwargs) - def get_tags(self, *args, **kwargs): - return "-".join([tag.tag_text for tag in self.tags.all()]) - class Choice(models.Model): """ diff --git a/polls/templates/polls/index.html b/polls/templates/polls/index.html index 44b75e5..bf0c9b0 100644 --- a/polls/templates/polls/index.html +++ b/polls/templates/polls/index.html @@ -90,6 +90,7 @@

{{ question.question_text }}


{{ question.short_description }}

+
👍 {{ question.up_vote_percentage }}% Upvoted @@ -97,12 +98,20 @@ 👎 {{ question.down_vote_percentage }}% Downvoted
- +
🕒 {{ question.time_left }} {{ question.participants }} Participants 👤
-
+ +
+ {% for tag in question.tags.all %} + {{ tag.tag_text }} + {% endfor %} +
+
+ +