##// END OF EJS Templates
Removed indexes in RSS. This is caused by problems with negative indexing, and...
neko259 -
r224:6490e2e7 default
parent child Browse files
Show More
@@ -6,8 +6,6 b' from neboard import settings'
6
6
7 __author__ = 'neko259'
7 __author__ = 'neko259'
8
8
9 MAX_ITEMS = 20
10
11 # TODO Make tests for all of these
9 # TODO Make tests for all of these
12 class AllThreadsFeed(Feed):
10 class AllThreadsFeed(Feed):
13
11
@@ -16,7 +14,7 b' class AllThreadsFeed(Feed):'
16 description_template = 'boards/rss/post.html'
14 description_template = 'boards/rss/post.html'
17
15
18 def items(self):
16 def items(self):
19 return Post.objects.get_threads(order_by='-pub_time')[-MAX_ITEMS:]
17 return Post.objects.get_threads(order_by='-pub_time')
20
18
21 def item_title(self, item):
19 def item_title(self, item):
22 return item.title
20 return item.title
@@ -35,7 +33,7 b' class TagThreadsFeed(Feed):'
35
33
36 def items(self, obj):
34 def items(self, obj):
37 return Post.objects.get_threads(tag=obj,
35 return Post.objects.get_threads(tag=obj,
38 order_by='-pub_time')[-MAX_ITEMS:]
36 order_by='-pub_time')
39
37
40 def get_object(self, request, tag_name):
38 def get_object(self, request, tag_name):
41 return get_object_or_404(Tag, name=tag_name)
39 return get_object_or_404(Tag, name=tag_name)
@@ -59,7 +57,7 b' class ThreadPostsFeed(Feed):'
59 description_template = 'boards/rss/post.html'
57 description_template = 'boards/rss/post.html'
60
58
61 def items(self, obj):
59 def items(self, obj):
62 return Post.objects.get_thread(opening_post_id=obj)[-MAX_ITEMS:]
60 return Post.objects.get_thread(opening_post_id=obj)
63
61
64 def get_object(self, request, post_id):
62 def get_object(self, request, post_id):
65 return post_id
63 return post_id
General Comments 0
You need to be logged in to leave comments. Login now