Deprecate choices argument in Select.render

49 views
Skip to first unread message

James Pic

unread,
Jan 24, 2016, 2:57:04 PM1/24/16
to django-d...@googlegroups.com
Hi all,

In Select widgets, as well as many other (including MultipleHiddenInput, where it's not used) rendering methods all have a choices=() kwarg and use a chain(self.choices, choices) when rendering.

Maybe I'm missing something, but it seems like this has just been sitting there since 2006 and all the sensible use cases for this have disappeared: why would anyone do the effort of adding a widget-specific override in Form.as_widget to add choices to rendering that won't even validate ?

Can we engage deprecation on the choices argument in render methods and rely on self.choices only or am I missing something ?

If so, do you know if any work on this has been started ?

Best

James

Tim Graham

unread,
Jan 24, 2016, 8:39:04 PM1/24/16
to Django developers (Contributions to Django itself)
Please see https://code.djangoproject.com/ticket/25731 for some discussion. Feel free to offer a patch so we can assess if it's feasible.

James Pic

unread,
Jan 24, 2016, 11:27:42 PM1/24/16
to django-d...@googlegroups.com
Felt free, thanks for answering.
Reply all
Reply to author
Forward
0 new messages