diff options
author | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-13 09:32:35 +0100 |
---|---|---|
committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2023-01-17 11:49:15 +0100 |
commit | 98756c685ee173bbd43f21ed0553f808be835ce5 (patch) | |
tree | f0d70ed7fa9348ba94d8889cf284792a880c28b2 /django/forms/utils.py | |
parent | b5ac6e78f838376b61f3f7dfccd66f906ad6d394 (diff) | |
download | django-98756c685ee173bbd43f21ed0553f808be835ce5.tar.gz |
Refs #32339 -- Changed default form and formset rendering style to div-based.
Per deprecation timeline.
This also removes "django/forms/default.html" and
"django/forms/formsets/default.html" templates.
Diffstat (limited to 'django/forms/utils.py')
-rw-r--r-- | django/forms/utils.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/django/forms/utils.py b/django/forms/utils.py index 7577c0bbda..e0888b6e85 100644 --- a/django/forms/utils.py +++ b/django/forms/utils.py @@ -1,16 +1,13 @@ import json -import warnings from collections import UserList from django.conf import settings from django.core.exceptions import ValidationError from django.forms.renderers import get_default_renderer from django.utils import timezone -from django.utils.deprecation import RemovedInDjango50Warning from django.utils.html import escape, format_html_join from django.utils.safestring import mark_safe from django.utils.translation import gettext_lazy as _ -from django.utils.version import get_docs_version def pretty_name(name): @@ -45,16 +42,6 @@ def flatatt(attrs): ) -DEFAULT_TEMPLATE_DEPRECATION_MSG = ( - 'The "default.html" templates for forms and formsets will be removed. These were ' - 'proxies to the equivalent "table.html" templates, but the new "div.html" ' - "templates will be the default from Django 5.0. Transitional renderers are " - "provided to allow you to opt-in to the new output style now. See " - "https://docs.djangoproject.com/en/%s/releases/4.1/ for more details" - % get_docs_version() -) - - class RenderableMixin: def get_context(self): raise NotImplementedError( @@ -65,13 +52,6 @@ class RenderableMixin: renderer = renderer or self.renderer template = template_name or self.template_name context = context or self.get_context() - if ( - template == "django/forms/default.html" - or template == "django/forms/formsets/default.html" - ): - warnings.warn( - DEFAULT_TEMPLATE_DEPRECATION_MSG, RemovedInDjango50Warning, stacklevel=2 - ) return mark_safe(renderer.render(template, context)) __str__ = render |