mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #32339 -- Deprecated default.html form template.
Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
This commit is contained in:
committed by
Carlton Gibson
parent
6af8673255
commit
d126eba363
@@ -15,6 +15,9 @@ def get_default_renderer():
|
||||
|
||||
|
||||
class BaseRenderer:
|
||||
# RemovedInDjango50Warning: When the deprecation ends, replace with
|
||||
# form_template_name = "django/forms/div.html"
|
||||
# formset_template_name = "django/forms/formsets/div.html"
|
||||
form_template_name = "django/forms/default.html"
|
||||
formset_template_name = "django/forms/formsets/default.html"
|
||||
|
||||
@@ -64,6 +67,31 @@ class Jinja2(EngineMixin, BaseRenderer):
|
||||
return Jinja2
|
||||
|
||||
|
||||
class DjangoDivFormRenderer(DjangoTemplates):
|
||||
"""
|
||||
Load Django templates from django/forms/templates and from apps'
|
||||
'templates' directory and use the 'div.html' template to render forms and
|
||||
formsets.
|
||||
"""
|
||||
|
||||
# RemovedInDjango50Warning Deprecate this class in 5.0 and remove in 6.0.
|
||||
|
||||
form_template_name = "django/forms/div.html"
|
||||
formset_template_name = "django/forms/formsets/div.html"
|
||||
|
||||
|
||||
class Jinja2DivFormRenderer(Jinja2):
|
||||
"""
|
||||
Load Jinja2 templates from the built-in widget templates in
|
||||
django/forms/jinja2 and from apps' 'jinja2' directory.
|
||||
"""
|
||||
|
||||
# RemovedInDjango50Warning Deprecate this class in 5.0 and remove in 6.0.
|
||||
|
||||
form_template_name = "django/forms/div.html"
|
||||
formset_template_name = "django/forms/formsets/div.html"
|
||||
|
||||
|
||||
class TemplatesSetting(BaseRenderer):
|
||||
"""
|
||||
Load templates using template.loader.get_template() which is configured
|
||||
|
||||
Reference in New Issue
Block a user