diff --git a/boards/models/post.py b/boards/models/post.py --- a/boards/models/post.py +++ b/boards/models/post.py @@ -115,7 +115,8 @@ class PostManager(models.Manager): posts = self.filter(poster_ip=ip) map(self.delete_post, posts) - # TODO Move this method to thread manager + # TODO This method may not be needed any more, because django's paginator + # is used def get_threads(self, tag=None, page=ALL_PAGES, order_by='-bump_time', archived=False): if tag: diff --git a/boards/views/__init__.py b/boards/views/__init__.py --- a/boards/views/__init__.py +++ b/boards/views/__init__.py @@ -36,6 +36,8 @@ def all_tags(request): return render(request, 'boards/tags.html', context) +# TODO Maybe this jumper is not needed any more? Only as a hack to find some +# post without knowing its thread def jump_to_post(request, post_id): """Determine thread in which the requested post is and open it's page""" diff --git a/boards/views/all_threads.py b/boards/views/all_threads.py --- a/boards/views/all_threads.py +++ b/boards/views/all_threads.py @@ -122,4 +122,4 @@ class AllThreadsView(PostMixin, BaseBoar return redirect('thread', post_id=thread_to_show) def get_threads(self): - return Thread.objects.filter(archived=False) + return Thread.objects.filter(archived=False).order_by('-bump_time') diff --git a/boards/views/tag_threads.py b/boards/views/tag_threads.py --- a/boards/views/tag_threads.py +++ b/boards/views/tag_threads.py @@ -12,7 +12,7 @@ class TagView(AllThreadsView): def get_threads(self): tag = get_object_or_404(Tag, name=self.tag_name) - return tag.threads.filter(archived=False) + return tag.threads.filter(archived=False).order_by('-bump_time') def get_context_data(self, **kwargs): context = super(TagView, self).get_context_data(**kwargs) @@ -25,4 +25,4 @@ class TagView(AllThreadsView): def get(self, request, tag_name, page=DEFAULT_PAGE): self.tag_name = tag_name - return super(TagView, self).get(request, page) \ No newline at end of file + return super(TagView, self).get(request, page)