Ticket #4323: 4323.diff

File 4323.diff, 1.1 KB (added by wangchun <yaohua2000@…>, 17 years ago)

patch

  • django/utils/feedgenerator.py

     
    121121    def write(self, outfile, encoding):
    122122        handler = SimplerXMLGenerator(outfile, encoding)
    123123        handler.startDocument()
    124         handler.startElement(u"rss", {u"version": self._version})
     124        handler.startElement(u"rss", {u"version": self._version, u"xmlns:dc": u"http://purl.org/dc/elements/1.1/"}})
    125125        handler.startElement(u"channel", {})
    126126        handler.addQuickElement(u"title", self.feed['title'])
    127127        handler.addQuickElement(u"link", self.feed['link'])
     
    168168                    (item['author_email'], item['author_name']))
    169169            elif item["author_email"]:
    170170                handler.addQuickElement(u"author", item["author_email"])
     171            elif item["author_name"]:
     172                handler.addQuickElement(u"dc:creator", item["author_name"])
    171173
    172174            if item['pubdate'] is not None:
    173175                handler.addQuickElement(u"pubDate", rfc2822_date(item['pubdate']).decode('ascii'))
Back to Top