This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CheckBoxBootstrapSwitch(CheckboxInput): | |
"""Django widget for bootstrap switch HTML widget: http://www.bootstrap-switch.org/ | |
Options can be provided through 'switch' argument: | |
switch = forms.BooleanField(required=False, label=_(u"bootstrap switch"), | |
widget=CheckBoxBootstrapSwitch(switch={'size': 'small', 'on': 'warning', 'text-label': 'Switch Me'})) | |
""" | |
def __init__(self, switch=None, *args, **kwargs): | |
self.switch = switch or {} | |
super(CheckBoxBootstrapSwitch, self).__init__(*args, **kwargs) |