[Django] #37268: django 6.1 breaks Media objects with reverse_lazy entries

0 views
Skip to first unread message

Django

unread,
5:37 AM (3 hours ago) 5:37 AM
to django-...@googlegroups.com
#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.

Django

unread,
6:30 AM (2 hours ago) 6:30 AM
to django-...@googlegroups.com
#37268: django 6.1 breaks Media objects with reverse_lazy entries
-------------------------------+--------------------------------------
Reporter: alex | Owner: (none)
Type: Uncategorized | Status: closed
Component: Forms | Version: 6.1
Severity: Normal | Resolution: duplicate
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by David Smith):

* resolution: => duplicate
* status: new => closed

Comment:

Thanks for the report. This seems to be a duplicate of #37262

Does the patch at https://github.com/django/django/pull/21752 work for
you. Your feedback there would be welcomed.
--
Ticket URL: <https://code.djangoproject.com/ticket/37268#comment:1>
Reply all
Reply to author
Forward
0 new messages