def __init__(self, select2attrs=None, *args, **kwargs):
        """
        Initialize default select2 attributes.

        If width is not provided, sets Select2 width to 250px.

        Args:
            select2attrs: a dictionary, which then passed to
                Select2 constructor function as options.
        """
        self.select2attrs = select2attrs or {}
        assert_msg = "select2attrs attribute must be dict, not {}"
        assert isinstance(self.select2attrs, dict), assert_msg.format(
                self.select2attrs.__class__.__name__
        )
        if 'width' not in self.select2attrs:
            self.select2attrs.update({'width': '250px'})
        super(Select2Mixin, self).__init__(*args, **kwargs)
def __init__ ( self , select2attrs = None , * args , ** kwargs ) : self . select2attrs = select2attrs or { } assert_msg = "select2attrs attribute must be dict, not {}" assert isinstance ( self . select2attrs , dict ) , assert_msg . format ( self . select2attrs . __class__ . __name__ ) if 'width' not in self . select2attrs : self . select2attrs . update ( { 'width' : '250px' } ) super ( Select2Mixin , self ) . __init__ ( * args , ** kwargs )
Initialize default select2 attributes.

        If width is not provided, sets Select2 width to 250px.

        Args:
            select2attrs: a dictionary, which then passed to
                Select2 constructor function as options.