如何将图像添加到 rss 提要,这是我的代码片段
class ArticlesRss(Feed):
description_template = 'feeds/city_description.html'
def get_object(self, request, categoryid):
if categoryid == 'all':
return False
else:
catobj = ArticleCategory.objects.get(id = categoryid)
return catobj
# set the category values
def title(self, obj):
if obj:
return obj.name
else:
return _('Latest Article')
def link(self, obj):
if obj:
return obj.get_absolute_url()
else:
return global_settings.website_url
# set the one by one objects
def item_title(self, item):
return item.title
def item_description(self, item):
return item.summary
def items(self, obj):
if obj:
return Article.objects.filter(category = obj,status='P').order_by('-id')[:15]
else:
return Article.objects.filter(status='P').order_by('-id')[:50]
我想在文章提要中添加图片(article_photo 是字段名称),如何将图片添加到提要中?