diff --git a/select2/widgets.py b/select2/widgets.py index 15ea20f..a4afd65 100644 --- a/select2/widgets.py +++ b/select2/widgets.py @@ -68,12 +68,12 @@ def __init__(self, attrs=None, choices=(), js_options=None, *args, **kwargs): self.attrs.update({ 'data-placeholder': kwargs.pop('overlay', None), - 'class': combine_css_classes(attrs.get('class', ''), self.default_class), 'data-sortable': json.dumps(self.sortable), }) - self.attrs.update(attrs) - self.choices = iter(choices) + self.attrs['class'] = combine_css_classes(attrs.get('class', ''), + self.default_class) + self.choices = choices def reverse(self, lookup_view): opts = getattr(self, 'model', self.field.model)._meta