def set_to_cache(self):
        try:
            cache.set(self._get_cache_key(), {
                'widget': self,
                'url': self.get_url(),
            })
        except (PicklingError, cPicklingError, AttributeError):
            msg = "You need to overwrite \"set_to_cache\" or ensure that %s is serialisable."
            raise NotImplementedError(msg % self.__class__.__name__)
Add widget object to Django's cache.
dataset/ETHPy150Open applegrew/django-select2/django_select2/forms.py/HeavySelect2Mixin.set_to_cache