我正在使用 Django 1.2,并且无法为播客生成好的 XML。任何包含单引号、双引号或 & 号的标题似乎都是双转义的,如下所示:
<title>Podcast: &quot;But we had hoped...&quot;</title>
这意味着它们显示如下:
Podcast: "But we had hoped"
我确实找到了这张票,但它很久以前就关闭了。
我正在使用这个片段生成我的提要,我只是将模型字段中的一个值填充self.title
到位中,如下所示:
class iTunesPodcastPost():
def __init__(self, talk):
self.id = talk.id
self.approval_date_time = talk.created
self.title = talk.title # Looks wonky
self.summary = talk.details # Looks fine
self.enclosure_url = talk.mp3.url
self.enclosure_length = talk.mp3.size
self.enclosure_mime_type = u'audio/mpeg'
self.duration = '%s' % talk.seconds
self.explicit = u'clean'
self.info_url = talk.get_absolute_url()
如果有帮助,播客提要在这里。