from lfs.shipping.models import ShippingMethod # reviews imports from reviews.signals import review_added # Shop def shop_changed_listener(sender, **kwargs): clear_cache() shop_changed.connect(shop_changed_listener) # Cart def cart_changed_listener(sender, **kwargs): update_cart_cache(sender) cart_changed.connect(cart_changed_listener) def cart_deleted_listener(sender, instance, **kwargs): update_cart_cache(instance) pre_delete.connect(cart_deleted_listener, sender=Cart) # Category def category_deleted_listener(sender, instance, **kwargs): update_category_cache(instance) pre_delete.connect(category_deleted_listener, sender=Category) def category_saved_listener(sender, instance, **kwargs): update_category_cache(instance)
# Shop def shop_changed_listener(sender, **kwargs): clear_cache() shop_changed.connect(shop_changed_listener) # Cart def cart_changed_listener(sender, **kwargs): update_cart_cache(sender) cart_changed.connect(cart_changed_listener) def cart_deleted_listener(sender, instance, **kwargs): update_cart_cache(instance) pre_delete.connect(cart_deleted_listener, sender=Cart) # Category def category_deleted_listener(sender, instance, **kwargs): update_category_cache(instance) pre_delete.connect(category_deleted_listener, sender=Category)