add the hashed field_id to the 'data-select2-id' attr

This commit is contained in:
Thomas Schreiber 2014-09-13 03:04:44 +02:00
parent 36bac0570f
commit e0686628d7

View file

@ -492,6 +492,7 @@ class HeavySelect2FieldBaseMixin(object):
# could have directly set field_id on it.
if hasattr(self, 'field_id'):
self.widget.field_id = self.field_id
self.widget.attrs['data-select2-id'] = self.field_id
# Widget should have been instantiated by now.
self.widget.field = self