Commit 7817a7bb authored by Gabor Nagy's avatar Gabor Nagy

Change `data-role` attribute for Select2TagsWidget.

Values from `data-tags` are picked up only when `data-role` is set to
`select2-tags` (according to `form.js`).
parent d8b27653
...@@ -33,8 +33,7 @@ class Select2TagsWidget(widgets.TextInput): ...@@ -33,8 +33,7 @@ class Select2TagsWidget(widgets.TextInput):
You must include select2.js, form-x.x.x.js and select2 stylesheet for it to work. You must include select2.js, form-x.x.x.js and select2 stylesheet for it to work.
""" """
def __call__(self, field, **kwargs): def __call__(self, field, **kwargs):
kwargs.setdefault('data-role', u'select2') kwargs.setdefault('data-role', u'select2-tags')
kwargs.setdefault('data-tags', u'1')
return super(Select2TagsWidget, self).__call__(field, **kwargs) return super(Select2TagsWidget, self).__call__(field, **kwargs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment