Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(5)  |  Derive(0)  |  Import(2)

src/m/h/MHST2013-14-HEAD/edx_all/edx-platform/cms/djangoapps/contentstore/views/assets.py   MHST2013-14(Download)
 
from mitxmako.shortcuts import render_to_response
from cache_toolbox.core import del_cached_content
from auth.authz import create_all_course_groups
 
 
    # delete cached thumbnail even if one couldn't be created this time (else the old thumbnail will continue to show)
    del_cached_content(thumbnail_location)
    # now store thumbnail location only if we could create it
    if thumbnail_content is not None:
        content.thumbnail_location = thumbnail_location
 
    # then commit the content
    contentstore().save(content)
    del_cached_content(content.location)
            contentstore().delete(thumbnail_content.get_id())
            # remove from any caching
            del_cached_content(thumbnail_content.location)
        except:
            pass  # OK if this is left dangling
 
    # delete the original
    contentstore().delete(content.get_id())
    # remove from cache
    del_cached_content(content.location)

src/m/h/MHST2013-14-HEAD/edx_all/edx-platform/cms/djangoapps/contentstore/tests/test_core_caching.py   MHST2013-14(Download)
from cache_toolbox.core import get_cached_content, set_cached_content, del_cached_content
from xmodule.modulestore import Location
from xmodule.contentstore.content import StaticContent
from django.test import TestCase
 
    def test_delete(self):
        set_cached_content(self.mockAsset)
        del_cached_content(self.nonUnicodeLocation)
        self.assertEqual(None, get_cached_content(self.unicodeLocation),
                         'should not be stored in cache with unicodeLocation')