Opened 7 years ago

Closed 7 years ago

Last modified 5 years ago

#24728 closed Cleanup/optimization (fixed)

feedgenerator classes still use "mime_type" instead of "content_type"

Reported by: Charlie DeTar Owned by: Raphael Michel
Component: contrib.syndication Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


The mimetype argument to HttpResponse and others was deprecated in v1.5 and removed in v1.7 in favor of content_type to be more semantically aligned with the HTTP header it represents. However, the feedgenerator classes django.utils.feedgenerator.RssFeed and django.utils.feedgenerator.Atom1Feed still use a mime_type attribute.

This leads to slightly ungainly semantics like:

    response = HttpResponse(content_type=feed.mime_type)

Might be aesthetically nicer to make this more consistent by using content_type across the board.

Change History (7)

comment:1 Changed 7 years ago by Tim Graham

Component: Uncategorizedcontrib.syndication
Triage Stage: UnreviewedAccepted
Type: UncategorizedCleanup/optimization
Version: 1.8master

Yes, but of course a deprecation of the current names is required. See Deprecating a Feature for a checklist of things to do when writing the patch.

comment:2 Changed 7 years ago by Raphael Michel

Owner: changed from nobody to Raphael Michel
Status: newassigned

comment:3 Changed 7 years ago by Raphael Michel

I renamed the attributes and started the deprecation in this pull request:

comment:4 Changed 7 years ago by Raphael Michel

Has patch: set

comment:5 Changed 7 years ago by Tim Graham

Triage Stage: AcceptedReady for checkin

comment:6 Changed 7 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed

In 5c125f6:

Fixed #24728 -- Renamed mime_type to content_type for syndication feeds

Renamed the mime_type properties of RssFeed and Atom1Feed to
content_type and start deprecation for the old names.

comment:7 Changed 5 years ago by Tim Graham <timograham@…>

In c6de8cc:

Refs #24728 - Removed Atom1Feed/RssFeed mime_type attribute.

Per deprecation timeline.

Note: See TracTickets for help on using tickets.
Back to Top