Show More
@@ -45,10 +45,10 b' class PostManager(models.Manager):' | |||
|
45 | 45 | self.delete_post(post) |
|
46 | 46 | |
|
47 | 47 | def get_threads(self, tag=None): |
|
48 |
if tag |
|
|
48 | if tag: | |
|
49 | threads = self.filter(parent=NO_PARENT, tags=tag) | |
|
50 | else: | |
|
49 | 51 | threads = self.filter(parent=NO_PARENT) |
|
50 | else: | |
|
51 | threads = self.filter(parent=NO_PARENT, tag=tag) | |
|
52 | 52 | threads = list(threads.order_by('-last_edit_time')) |
|
53 | 53 | |
|
54 | 54 | return threads |
@@ -65,7 +65,7 b' def tag(request, tag_name):' | |||
|
65 | 65 | """Get all tag threads (posts without a parent).""" |
|
66 | 66 | |
|
67 | 67 | tag = Tag.objects.get(name=tag_name) |
|
68 |
threads = |
|
|
68 | threads = Post.objects.get_threads(tag=tag) | |
|
69 | 69 | |
|
70 | 70 | if request.method == 'POST': |
|
71 | 71 | return new_post(request) |
@@ -19,7 +19,7 b'' | |||
|
19 | 19 | [{{ thread.pub_time }}] |
|
20 | 20 | <a class="link" href="/thread/{{ thread.id }}/"> |
|
21 | 21 | [{% trans "View" %}]</a><br /> |
|
22 | {{ thread.text }}<br /> | |
|
22 | {{ thread.text|truncatechars:300 }}<br /> | |
|
23 | 23 | {% if thread.tags %} |
|
24 | 24 | <span class="tags">{% trans 'Tags' %}: |
|
25 | 25 | {% for tag in thread.tags.all %} |
General Comments 0
You need to be logged in to leave comments.
Login now