code: def get_cached_object(model, timeout=CACHE_TIMEOUT, **kwargs):
      
      if not isinstance(model, ContentType):
          model_ct = ContentType.objects.get_for_model(model)
      else:
          model_ct = model
  
      key = _get_key(KEY_PREFIX, model_ct, **kwargs)
  
      obj = cache.get(key)
      if obj is None:
          # if we are looking for a publishable, fetch just the actual content
          # type and then fetch the actual object
          if model_ct.app_label == 'core' and model_ct.model == 'publishable':
              actual_ct_id = model_ct.model_class()._default_manager.values('content_type_id').get(**kwargs)['content_type_id']
              model_ct = ContentType.objects.get_for_id(actual_ct_id)
  
          # fetch the actual object we want
          obj = model_ct.model_class()._default_manager.get(**kwargs)
  
          # since 99% of lookups are done via PK make sure we set the cache for
          # that lookup even if we retrieved it using a different one.
          if 'pk' in kwargs:
              cache.set(key, obj, timeout)
          elif not isinstance(cache, DummyCache):
              cache.set_many({key: obj, _get_key(KEY_PREFIX, model_ct, pk=obj.pk): obj}, timeout=timeout)
  
      return obj
docs: Return a cached object. If the object does not exist in the cache, create it.
  
      Params:
          model - ContentType instance representing the model's class or the model class itself
          timeout - TTL for the item in cache, defaults to CACHE_TIMEOUT
          **kwargs - lookup parameters for content_type.get_object_for_this_type and for key creation
  
      Throws:
          model.DoesNotExist is propagated from content_type.get_object_for_this_type