Usage

Custom Content

The BootstrapSelect widget will take the labels from choices and render them as custom-content

def get_choices():
    choices = (('face.jpg', escape('<img src="path-to-face.jpg"/>'),)
    return choices

class IconForm(forms.Form):
    icon = forms.URLField(widget=BootstrapSelect(choices=get_choices()))

Assets

If you do not want some of the assets provided, there are two options:

Assets can be controlled globally through settings:

BOOTSTRAP_SELECT_ASSETS = {
    'bootstrap_js': False,
    'bootstrap_css': False,
    'jquery_js': False,

}

Assets can also be declared as widget kwargs:

class ExampleForm(forms.Form):
    icon = forms.URLField(
            widget=BootstrapSelect(choices=self.CHOICES,
                                   bootstrap_js=False,
                                   bootstrap_css=False,
                                   jquery_js=False,)
    )