Ticket #11303: hidden_input.diff

File hidden_input.diff, 527 bytes (added by oduvan, 6 years ago)
  • django/forms/widgets.py

     
    233233class HiddenInput(Input):
    234234    input_type = 'hidden'
    235235    is_hidden = True
     236    def render(self, name, value, attrs=None):
     237        if isinstance(value,bool):
     238            value = value and 'on' or ''
     239        return super(HiddenInput,self).render(name,value,attrs)
    236240
    237241class MultipleHiddenInput(HiddenInput):
    238242    """
Back to Top