import types from django import forms from django.utils.safestring import mark_safe from django.core.urlresolvers import reverse class JSFunction(str): pass class Select2Mixin(object): # For details on these options refer: http://ivaynberg.github.com/select2/#documentation options = { 'minimumInputLength': 2, 'minimumResultsForSearch': 6, # Only applicable for single value select. 'placeholder': '', 'allowClear': True, # Not allowed when field is multiple since there each value has a clear button. 'multiple': False, # Not allowed when attached to