1
0
mirror of https://github.com/django/django.git synced 2025-10-24 06:06:09 +00:00

Emphasized that TemplatesSetting must be used to override widget templates.

This commit is contained in:
Stephen Finucane
2018-09-11 13:14:53 -06:00
committed by Tim Graham
parent 32fbccab40
commit 25f4302349
2 changed files with 10 additions and 3 deletions

View File

@@ -114,6 +114,8 @@ Some widgets add further information to the context. For instance, all widgets
that subclass ``Input`` defines ``widget['type']`` and :class:`.MultiWidget`
defines ``widget['subwidgets']`` for looping purposes.
.. _overriding-built-in-widget-templates:
Overriding built-in widget templates
====================================
@@ -123,6 +125,6 @@ Each widget has a ``template_name`` attribute with a value such as
``input.html`` by defining ``django/forms/widgets/input.html``, for example.
See :ref:`built-in widgets` for the name of each widget's template.
If you use the :class:`TemplatesSetting` renderer, overriding widget templates
works the same as overriding any other template in your project. You can't
override built-in widget templates using the other built-in renderers.
To override widget templates, you must use the :class:`TemplatesSetting`
renderer. Then overriding widget templates works :doc:`the same as
</howto/overriding-templates>` overriding any other template in your project.