django
django copied to clipboard
Refs #33166 -- Added field to context when rendering widget.
This pull request to fix ticket #14955 is far less intrusive than the previous version.
It now is ready for review.
I think #16574 is the right step towards resolving this this. IF we decide that's the right way to go. It introduces the concept of a boundwidget. A boundwiget being "a widget plus data" it should therefore know everything about itself, including which form it belongs to.
It's not there yet, but a further step would move the render/get context to that class instead of the widget itself. get_contex()
would then be able to access all that info and avoid passing it into the render method.
https://github.com/django/django/blob/51c9bb7cd16081133af4f0ab6d06572660309730/django/forms/widgets.py#L259
@jrief What do you think about #16574? See comment.
Thanks for your email. It has been received and is being attended to by our team.
On Thu, Feb 23, 2023 at 7:02 AM Mariusz Felisiak @.***> wrote:
@jrief https://github.com/jrief What do you think about #16574 https://github.com/django/django/pull/16574? See comment https://github.com/django/django/pull/14955#issuecomment-1441349978.
— Reply to this email directly, view it on GitHub https://github.com/django/django/pull/14955#issuecomment-1441642091, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6RARUIMBNU6NHTAX4ED5TWY5GWHANCNFSM5FSMBDEQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Closing per ticket.