diff --git a/boards/models/post.py b/boards/models/post.py --- a/boards/models/post.py +++ b/boards/models/post.py @@ -289,4 +289,7 @@ class Thread(models.Model): return self.get_replies()[0] def __unicode__(self): - return str(self.get_replies()[0].id) \ No newline at end of file + return str(self.get_replies()[0].id) + + def get_pub_time(self): + return self.get_opening_post().pub_time \ No newline at end of file diff --git a/boards/rss.py b/boards/rss.py --- a/boards/rss.py +++ b/boards/rss.py @@ -15,7 +15,7 @@ class AllThreadsFeed(Feed): description_template = 'boards/rss/post.html' def items(self): - return Post.objects.get_threads(order_by='-pub_time') + return Post.objects.get_threads() # TODO Order this by OP's pub time def item_title(self, item): return item.get_opening_post().title @@ -33,8 +33,7 @@ class TagThreadsFeed(Feed): description_template = 'boards/rss/post.html' def items(self, obj): - return Post.objects.get_threads(tag=obj, - order_by='-pub_time') + return Post.objects.get_threads(tag=obj) # TODO Order this by OP's pub time def get_object(self, request, tag_name): return get_object_or_404(Tag, name=tag_name) @@ -46,7 +45,7 @@ class TagThreadsFeed(Feed): return reverse('thread', args={item.get_opening_post().id}) def item_pubdate(self, item): - return item.pub_time + return item.get_pub_time() def title(self, obj): return obj.name @@ -67,8 +66,8 @@ class ThreadPostsFeed(Feed): return item.title def item_link(self, item): - if item.thread: - return reverse('thread', args={item.thread.get_opening_post() + if not item.is_opening(): + return reverse('thread', args={item.thread_new.get_opening_post() .id}) + "#" + str(item.id) else: return reverse('thread', args={item.id}) 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 @@ -6,7 +6,7 @@ {% load board %} {% block head %} -