def set_to_cache(self):
        """
        Add widget object to Django's cache.

        You may need to overwrite this method, to pickle all information
        that is required to serve your JSON response view.
        """
        try:
            cache.set(self._get_cache_key(), {
                'widget': self,
                'url': self.get_url(),
            })
        except (PicklingError, cPicklingError, __HOLE__):
            msg = "You need to overwrite \"set_to_cache\" or ensure that %s is serialisable."
            raise NotImplementedError(msg % self.__class__.__name__)
dataset/ETHPy150Open applegrew/django-select2/django_select2/forms.py/HeavySelect2Mixin.set_to_cache