I think this is a bit over the top, and results in a lot of complexity. I
couldn't find a good reason to why this is actually implemented that way.
I'd like to drop one of the two. Ether remove the choices from the
instance and keep passing them in all methods, or preferable remove them
from the method signatures.
The latter I think is cleaner but does include a bit of deprecation.
Cheers,
Joe
--
Ticket URL: <https://code.djangoproject.com/ticket/25731>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
It's a bit difficult for me to evaluate the ticket without some working
code. Upon working on it, you might find the reason for the current
implementation. Can you provide a patch?
--
Ticket URL: <https://code.djangoproject.com/ticket/25731#comment:1>
Comment (by codingjoe):
Tim, I could work on a patch, but I'd like to make a design decision
first.
As I see it, the only reason why there is the option to pass choices into
the renderer directly is the `ModelChoiceIterator`.
Where the regular choices get cast into a list, this would be a very poor
idea for the `ModelChoiceIterator`.
The question is, should we allow Widgets to be rendered multiple times and
drop the instance attribute, or should we not.
Another option would be to deepcopy the choices when they're being
rendered.
--
Ticket URL: <https://code.djangoproject.com/ticket/25731#comment:2>
Comment (by timgraham):
I think it's very likely that some users render widgets multiple times on
a page for whatever reason, so I don't think removing that functionality
is an option.
--
Ticket URL: <https://code.djangoproject.com/ticket/25731#comment:3>
* status: new => closed
* resolution: => needsinfo
Comment:
Please reopen if you can provide a patch, otherwise I'm not sure how to
proceed with this ticket.
--
Ticket URL: <https://code.djangoproject.com/ticket/25731#comment:4>
Comment (by jpic):
Agreed that this part is a bit fuzzy, seems like a leftover from before a
refactor.
I do not see any valid use case for this argument, why would a user put so
much effort into appending options that won't validate to a select widget
?
Patch proposed: https://github.com/django/django/pull/6037
--
Ticket URL: <https://code.djangoproject.com/ticket/25731#comment:5>
* cc: jpic (added)
--
Ticket URL: <https://code.djangoproject.com/ticket/25731#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"65c13f9675d2ca7fc1c925e7182a2e35d07ff5fb" 65c13f96]:
{{{
#!CommitTicketReference repository=""
revision="65c13f9675d2ca7fc1c925e7182a2e35d07ff5fb"
Refs #25731 -- Removed unused MultipleHiddenInput choices
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25731#comment:7>
* status: closed => new
* has_patch: 0 => 1
* resolution: needsinfo =>
* stage: Unreviewed => Accepted
Comment:
[https://github.com/django/django/pull/6037 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/25731#comment:8>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"926e90132dc15d76bb8d16e2f9f1279566cac3c3" 926e9013]:
{{{
#!CommitTicketReference repository=""
revision="926e90132dc15d76bb8d16e2f9f1279566cac3c3"
Fixed #25731 -- Removed unused choices kwarg for Select.render()
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25731#comment:9>