#37268: django 6.1 breaks Media objects with reverse_lazy entries
----------------------+-----------------------------------------
Reporter: alex | Type: Uncategorized
Status: new | Component: Forms
Version: 6.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
----------------------+-----------------------------------------
== Problem
sometimes you want to use reverse_lazy for referencing internal urls in
forms, widgets and other Media objects.
With the new change to `Script`, `Stylesheet`, ... this fails. Both
classes cannot lazy load and when a lazy object is defined it is tried to
access `.__html__()` which fails.
What should happen instead is to resolve reverse_lazy when it is really
required. Both classes should support lazy objects too.
== Why `reverse` won't work in such situations:
This won't work in admin. Calling `reverse` too early; e.g. when defining
the media object can break the application.
--
Ticket URL: <
https://code.djangoproject.com/ticket/37268>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.