Code

Opened 7 years ago

Closed 7 years ago

#3034 closed enhancement (fixed)

Added "mimetype" param to django.views.generic.simple.direct_to_template

Reported by: Paul Bx <pb@…> Owned by: jacob
Component: Generic views Version: master
Severity: normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I think direct_to_template is the only generic view that doesn't take a "mimetype" param. This patch remedies that. The use-case that drove me to write this was wanting robots.txt to have the right Content-Type. I'm sure there are others (CSS generation and JS generation come to mind).

I've tested this with a dummy project and via runtests.py (though direct_to_template doesn't seem to be covered).

Attachments (1)

dtt_mimetype.diff (1.2 KB) - added by Paul Bx <pb@…> 7 years ago.
the patch

Download all attachments as: .zip

Change History (3)

Changed 7 years ago by Paul Bx <pb@…>

the patch

comment:1 Changed 7 years ago by Simon G. <dev@…>

  • Component changed from Template system to Generic views
  • Owner changed from adrian to jacob
  • Summary changed from [patch] Added "mimetype" param to django.views.generic.simple.direct_to_template to Added "mimetype" param to django.views.generic.simple.direct_to_template
  • Triage Stage changed from Unreviewed to Ready for checkin

comment:2 Changed 7 years ago by mtredinnick

  • Resolution set to fixed
  • Status changed from new to closed

(In [4983]) Fixed #3034 -- Added mimetype parameter to the direct_to_template() generic
view, for consistency with the other generic views. Thanks, Paul Bx.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.