Changes between Initial Version and Version 1 of Ticket #5247, comment 17
- Timestamp:
- Aug 25, 2017, 11:34:24 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #5247, comment 17
initial v1 1 1 Having ran into a similar problem I am wondering on the status of this ticket. My situation is using a CheckboxSelectMultiple for a ModelMultipleChoiceField with CheckboxSelectMultiple. Behaviour of this combination seems fine with the notable exception of initial values, much like the problem mentioned in this ticket. My fix is trivial to subclass the checkbox widget thus: 2 2 3 3 {{{ 4 4 class ModelCheckboxSelectMultiple(CheckboxSelectMultiple): 5 5 def render(self, name, value, attrs=None, choices=()): … … 11 11 selected_keys.append(v.pk) 12 12 return super(ModelCheckboxSelectMultiple, self).render(name, selected_keys, attrs, choices) 13 13 }}} 14 14 Looking for direction on this and I would be happy to open a new ticket if that makes sense.