[Django] #33876: "default.html" deprecation warning raised for ManagementForm's

27 views
Skip to first unread message

Django

unread,
Jul 29, 2022, 9:20:38 AM7/29/22
to django-...@googlegroups.com
#33876: "default.html" deprecation warning raised for ManagementForm's
------------------------------------------------+------------------------
Reporter: Claude Paroz | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Forms | Version: 4.1
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 |
------------------------------------------------+------------------------
I have a project where I never render forms with the `{{ form }}`
expression. However, I'm still getting the new template deprecation
warning because of the formset management form production, during which
the template used is insignificant (only hidden inputs are produced).

Is it worth special-casing this and avoid producing the warning for the
management forms?

--
Ticket URL: <https://code.djangoproject.com/ticket/33876>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 1, 2022, 4:46:22 AM8/1/22
to django-...@googlegroups.com
#33876: "default.html" deprecation warning raised for ManagementForm's
--------------------------------------+------------------------------------

Reporter: Claude Paroz | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Forms | Version: 4.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* cc: David Smith, Carlton Gibson (added)
* severity: Normal => Release blocker
* stage: Unreviewed => Accepted


Comment:

Thanks for the report. I think it's worth changing. As far as I'm aware,
it's quite often that management form is the only one that users render
with `{{ form }}`. It should also be quite easy to workaround:
{{{#!diff
diff --git a/django/forms/formsets.py b/django/forms/formsets.py
index 3adbc6979a..2bea2987be 100644
--- a/django/forms/formsets.py
+++ b/django/forms/formsets.py
@@ -31,6 +31,7 @@ class ManagementForm(Form):
new forms via JavaScript, you should increment the count field of
this form
as well.
"""
+ template_name = "django/forms/div.html" # RemovedInDjango50Warning.

TOTAL_FORMS = IntegerField(widget=HiddenInput)
INITIAL_FORMS = IntegerField(widget=HiddenInput)

}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33876#comment:1>

Django

unread,
Aug 2, 2022, 3:09:00 AM8/2/22
to django-...@googlegroups.com
#33876: "default.html" deprecation warning raised for ManagementForm's
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: assigned

Component: Forms | Version: 4.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* owner: nobody => Carlton Gibson
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/33876#comment:2>

Django

unread,
Aug 2, 2022, 3:36:30 AM8/2/22
to django-...@googlegroups.com
#33876: "default.html" deprecation warning raised for ManagementForm's
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: assigned
Component: Forms | Version: 4.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/15902 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/33876#comment:3>

Django

unread,
Aug 2, 2022, 4:18:09 AM8/2/22
to django-...@googlegroups.com
#33876: "default.html" deprecation warning raised for ManagementForm's
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: assigned
Component: Forms | Version: 4.1
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33876#comment:4>

Django

unread,
Aug 2, 2022, 4:31:03 AM8/2/22
to django-...@googlegroups.com
#33876: "default.html" deprecation warning raised for ManagementForm's
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: closed
Component: Forms | Version: 4.1
Severity: Release blocker | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson <carlton@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"89e695a69b16b8c0e720169b3ca4852cfd0c485f" 89e695a]:
{{{
#!CommitTicketReference repository=""
revision="89e695a69b16b8c0e720169b3ca4852cfd0c485f"
Fixed #33876, Refs #32229 -- Made management forms render with div.html
template.

Thanks to Claude Paroz for the report.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33876#comment:5>

Django

unread,
Aug 2, 2022, 4:31:46 AM8/2/22
to django-...@googlegroups.com
#33876: "default.html" deprecation warning raised for ManagementForm's
-------------------------------------+-------------------------------------
Reporter: Claude Paroz | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: closed
Component: Forms | Version: 4.1
Severity: Release blocker | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Carlton Gibson <carlton.gibson@…>):

In [changeset:"8aab03ab5550d8da9268eb384bfc7092dd4fab0a" 8aab03a]:
{{{
#!CommitTicketReference repository=""
revision="8aab03ab5550d8da9268eb384bfc7092dd4fab0a"
[4.1.x] Fixed #33876, Refs #32229 -- Made management forms render with
div.html template.

Thanks to Claude Paroz for the report.

Backport of 89e695a69b16b8c0e720169b3ca4852cfd0c485f from main
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33876#comment:6>

Reply all
Reply to author
Forward
0 new messages