Changes between Initial Version and Version 1 of Ticket #5247, comment 17


Ignore:
Timestamp:
Aug 25, 2017, 11:34:24 AM (7 years ago)
Author:
Tim Graham

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #5247, comment 17

    initial v1  
    11Having 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:
    22
    3 
     3{{{
    44class ModelCheckboxSelectMultiple(CheckboxSelectMultiple):
    55    def render(self, name, value, attrs=None, choices=()):
     
    1111            selected_keys.append(v.pk)
    1212        return super(ModelCheckboxSelectMultiple, self).render(name, selected_keys, attrs, choices)
    13 
     13}}}
    1414Looking for direction on this and I would be happy to open a new ticket if that makes sense.
Back to Top