##// END OF EJS Templates
Fixed RSS items. Now getting the latest ones instead of the earliest.
neko259 -
r214:eb81a357 default
parent child Browse files
Show More
@@ -16,7 +16,7 b' class AllThreadsFeed(Feed):'
16 description_template = 'boards/rss/post.html'
16 description_template = 'boards/rss/post.html'
17
17
18 def items(self):
18 def items(self):
19 return Post.objects.get_threads(order_by='-pub_time')[:MAX_ITEMS]
19 return Post.objects.get_threads(order_by='-pub_time')[-MAX_ITEMS:]
20
20
21 def item_title(self, item):
21 def item_title(self, item):
22 return item.title
22 return item.title
@@ -35,7 +35,7 b' class TagThreadsFeed(Feed):'
35
35
36 def items(self, obj):
36 def items(self, obj):
37 return Post.objects.get_threads(tag=obj,
37 return Post.objects.get_threads(tag=obj,
38 order_by='-pub_time')[:MAX_ITEMS]
38 order_by='-pub_time')[-MAX_ITEMS:]
39
39
40 def get_object(self, request, tag_name):
40 def get_object(self, request, tag_name):
41 return get_object_or_404(Tag, name=tag_name)
41 return get_object_or_404(Tag, name=tag_name)
@@ -59,7 +59,7 b' class ThreadPostsFeed(Feed):'
59 description_template = 'boards/rss/post.html'
59 description_template = 'boards/rss/post.html'
60
60
61 def items(self, obj):
61 def items(self, obj):
62 return Post.objects.get_thread(opening_post_id=obj)[:MAX_ITEMS]
62 return Post.objects.get_thread(opening_post_id=obj)[-MAX_ITEMS:]
63
63
64 def get_object(self, request, post_id):
64 def get_object(self, request, post_id):
65 return post_id
65 return post_id
General Comments 0
You need to be logged in to leave comments. Login now