Example #1
0
def set_configuration(shop=None, category=None, data=None):
    if category and category.pk:
        configuration.set(None, _get_category_configuration_key(category), data)
    elif shop:
        configuration.set(shop, FACETED_DEFAULT_CONF_KEY, data)
        cache.bump_version(get_theme_cache_key(shop))

    # clear active keys
    context_cache.bump_cache_for_item(category)
    if not category:
        from shuup.core.models import Category
        for cat_pk in Category.objects.all().values_list("pk", flat=True):
            context_cache.bump_cache_for_pk(Category, cat_pk)
Example #2
0
def set_configuration(shop=None, category=None, data=None):
    if category and category.pk:
        configuration.set(None, _get_category_configuration_key(category), data)
    elif shop:
        configuration.set(shop, FACETED_DEFAULT_CONF_KEY, data)
        cache.bump_version(get_theme_cache_key(shop))

    # clear active keys
    context_cache.bump_cache_for_item(category)
    if not category:
        from shuup.core.models import Category
        for cat_pk in Category.objects.all().values_list("pk", flat=True):
            context_cache.bump_cache_for_pk(Category, cat_pk)