diff --git a/boards/models.py b/boards/models.py --- a/boards/models.py +++ b/boards/models.py @@ -311,6 +311,11 @@ class Post(models.Model): return last_replies + def get_tags(self): + """Get a sorted tag list""" + + return self.tags.order_by('name') + class User(models.Model): diff --git a/boards/templates/boards/posting_general.html b/boards/templates/boards/posting_general.html --- a/boards/templates/boards/posting_general.html +++ b/boards/templates/boards/posting_general.html @@ -84,7 +84,7 @@ {{ thread.thread.get_images_count }} {% trans 'images' %}. {% if thread.thread.tags %} - {% for tag in thread.thread.tags.all %} + {% for tag in thread.thread.get_tags %} #{{ tag.name }} diff --git a/boards/templates/boards/thread.html b/boards/templates/boards/thread.html --- a/boards/templates/boards/thread.html +++ b/boards/templates/boards/thread.html @@ -78,7 +78,7 @@ {% if post.id == posts.0.id %}
- {% for tag in post.tags.all %} + {% for tag in post.get_tags %} #{{ tag.name }} {% endfor %}