Django

Code

Changeset 1201

Show
Ignore:
Timestamp:
11/12/05 12:32:12 (3 years ago)
Author:
adrian
Message:

Added mime_type attributes to feedgenerator RssFeed? and Atom1Feed, and made the syndication view use that mime_type. Thanks, James

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/contrib/syndication/views.py

    r1194 r1201  
    2222        raise Http404, "Invalid feed parameters. Slug %r is valid, but other parameters, or lack thereof, are not." % slug 
    2323 
    24     response = HttpResponse(mimetype='application/xml'
     24    response = HttpResponse(mimetype=feedgen.mime_type
    2525    feedgen.write(response, 'utf-8') 
    2626    return response 
  • django/trunk/django/utils/feedgenerator.py

    r1194 r1201  
    112112 
    113113class RssFeed(SyndicationFeed): 
     114    mime_type = 'application/rss+xml' 
    114115    def write(self, outfile, encoding): 
    115116        handler = SimplerXMLGenerator(outfile, encoding) 
     
    177178class Atom1Feed(SyndicationFeed): 
    178179    # Spec: http://atompub.org/2005/07/11/draft-ietf-atompub-format-10.html 
     180    mime_type = 'application/atom+xml' 
    179181    ns = u"http://www.w3.org/2005/Atom" 
    180182    def write(self, outfile, encoding):