Skip to content

Commit 217061d

Browse files
committed
RSS订阅仅显示发布的文章
1 parent e1bdc27 commit 217061d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

DjangoBlog/feeds.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def author_link(self):
3636
return get_user_model().objects.first().get_absolute_url()
3737

3838
def items(self):
39-
return Article.objects.order_by('-pk')[:5]
39+
return Article.objects.filter(type='a', status='p').order_by('-pub_time')[:5]
4040

4141
def item_title(self, item):
4242
return item.title

0 commit comments

Comments
 (0)