Opened 9 years ago

Closed 9 years ago

Last modified 7 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

Description

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 by Tim Graham, 9 years ago

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 by Raphael Michel, 9 years ago

Owner: changed from nobody to Raphael Michel
Status: newassigned

comment:3 by Raphael Michel, 9 years ago

I renamed the attributes and started the deprecation in this pull request: https://github.com/django/django/pull/4760

comment:4 by Raphael Michel, 9 years ago

Has patch: set

comment:5 by Tim Graham, 9 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Tim Graham <timograham@…>, 9 years ago

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 by Tim Graham <timograham@…>, 7 years ago

In c6de8cc:

Refs #24728 - Removed Atom1Feed/RssFeed mime_type attribute.

Per deprecation timeline.

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