def create_menus(sender, **kwargs): if issubclass(sender, BaseSection): created = kwargs.get('created', False) instance = kwargs.get('instance') if created: menu_name = 'Main menu of %s' % unicode(instance) instance.main_menu = Menu.objects.create(**{'slug': defaultfilters.slugify(menu_name), get_fallback_fieldname('name'): menu_name}) from merengue.cache import invalidate_johnny_cache invalidate_johnny_cache(instance.__class__, True, BaseSection) instance.save()
def create_menus(sender, **kwargs): if issubclass(sender, BaseSection): created = kwargs.get('created', False) instance = kwargs.get('instance') if created: menu_name = 'Main menu of %s' % unicode(instance) instance.main_menu = Menu.objects.create( **{ 'slug': defaultfilters.slugify(menu_name), get_fallback_fieldname('name'): menu_name }) from merengue.cache import invalidate_johnny_cache invalidate_johnny_cache(instance.__class__, True, BaseSection) instance.save()
def invalidate_registereditem(): from merengue.cache import invalidate_johnny_cache from merengue.registry.models import RegisteredItem invalidate_johnny_cache(RegisteredItem)