#34531: Rendering form throws deprecation warning -----------------------------------------+------------------------ Reporter: Petr DlouhĂ˝ | Owner: nobody Type: Uncategorized | Status: new Component: Forms | Version: 4.2 Severity: Normal | Keywords: Triage Stage: Unreviewed | Has patch: 0 Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -----------------------------------------+------------------------ When I execute following code: {{{ # deprecation.py from django.forms import Form from django.template import Template, Context t = Template("{{ form }}") c = Context({"form": Form}) t.render(c) }}} with {{{ python -Wall -W warning::DeprecationWarning ./manage.py shell < deprecation.py }}}
I git following error: {{{ .../lib/python3.11/site-packages/django/template/base.py:1047: RemovedInDjango50Warning: 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/4.2/releases/4.1/ for more details value = str(value) }}} I think this is incorrect behavior, since the deprecated code is contained only in Django (django/forms/renders.py line 21) and not in the users code. This breaks automated tests which should ensure future Django compatibility. It is possible to fix them only by some hacks. Django version: 4.2 Python version: 3.11.3 -- Ticket URL: <https://code.djangoproject.com/ticket/34531> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/01070187dccd10fa-61f56d75-c8fe-45f9-a846-97138f39972d-000000%40eu-central-1.amazonses.com.