Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#28945 closed Bug (wontfix)

widgets.Input should support non-app custom template_names

Reported by: Jonas Haag Owned by: nobody
Component: Forms Version: 2.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

If you make your own django.forms.widgets.Input subclass an overwrite the template_name argument, Django will only look in django/forms/templates/ and in your app dirs, but not in any templates defined in a settings.TEMPLATES[...]['DIRS'] dir.

class MyInput(widgets.Input):
    template_name = 'foo.html'

Even if I have spam/templates in DIRS, it won't look for spam/templates/foo.html.

We should at least document this.

Change History (2)

comment:1 by Tim Graham, 7 years ago

Component: UncategorizedForms
Resolution: wontfix
Status: newclosed

It sounds like you haven't read the existing documentation.

comment:2 by Jonas Haag, 7 years ago

Must have missed this. Sorry and thanks Tim!

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