#24728 closed Cleanup/optimization (fixed)
feedgenerator classes still use "mime_type" instead of "content_type"
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 , 10 years ago
Component: | Uncategorized → contrib.syndication |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → Cleanup/optimization |
Version: | 1.8 → master |
comment:2 by , 10 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 10 years ago
I renamed the attributes and started the deprecation in this pull request: https://github.com/django/django/pull/4760
comment:4 by , 10 years ago
Has patch: | set |
---|
comment:5 by , 10 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
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.