def set_to_cache(self):
queryset = self.get_queryset()<EOL>cache.set(self._get_cache_key(), {<EOL>'<STR_LIT>':<EOL>[<EOL>queryset.none(),<EOL>queryset.query,<EOL>],<EOL>'<STR_LIT>': self.__class__,<EOL>'<STR_LIT>': tuple(self.search_fields),<EOL>'<STR_LIT>': int(self.max_results),<EOL>'<STR_LIT:url>': str(self.get_url()),<EOL>'<STR_LIT>': dict(self.dependent_fields),<EOL>})<EOL>
Add widget's attributes to Django's cache.

Split the QuerySet, to not pickle the result set.