Show More
@@ -1,7 +1,7 b'' | |||||
1 | from django.contrib.syndication.views import Feed |
|
1 | from django.contrib.syndication.views import Feed | |
2 | from django.core.urlresolvers import reverse |
|
2 | from django.core.urlresolvers import reverse | |
3 | from django.shortcuts import get_object_or_404 |
|
3 | from django.shortcuts import get_object_or_404 | |
4 | from boards.models import Post, Tag, Thread |
|
4 | from boards.models import Post, Tag, Thread, TagAlias | |
5 | from boards import settings |
|
5 | from boards import settings | |
6 | from boards.models.thread import STATUS_ARCHIVE |
|
6 | from boards.models.thread import STATUS_ARCHIVE | |
7 |
|
7 | |||
@@ -37,10 +37,10 b' class TagThreadsFeed(Feed):' | |||||
37 | description_template = 'boards/rss/post.html' |
|
37 | description_template = 'boards/rss/post.html' | |
38 |
|
38 | |||
39 | def items(self, obj): |
|
39 | def items(self, obj): | |
40 | return Post.objects.filter(opening=True, thread__tags__in=[obj]).exclude(thread__status=STATUS_ARCHIVE).order_by('-id')[:MAX_ITEMS] |
|
40 | return Post.objects.filter(opening=True, thread__tags__aliases__name__in=[obj]).exclude(thread__status=STATUS_ARCHIVE).order_by('-id')[:MAX_ITEMS] | |
41 |
|
41 | |||
42 | def get_object(self, request, tag_name): |
|
42 | def get_object(self, request, tag_name): | |
43 | return get_object_or_404(Tag, name=tag_name) |
|
43 | return get_object_or_404(TagAlias, name=tag_name).parent | |
44 |
|
44 | |||
45 | def item_title(self, item): |
|
45 | def item_title(self, item): | |
46 | return item.title |
|
46 | return item.title | |
@@ -52,7 +52,7 b' class TagThreadsFeed(Feed):' | |||||
52 | return item.pub_time |
|
52 | return item.pub_time | |
53 |
|
53 | |||
54 | def title(self, obj): |
|
54 | def title(self, obj): | |
55 | return obj.name |
|
55 | return obj.get_name() | |
56 |
|
56 | |||
57 |
|
57 | |||
58 | class ThreadPostsFeed(Feed): |
|
58 | class ThreadPostsFeed(Feed): |
General Comments 0
You need to be logged in to leave comments.
Login now