blob: fa558175b8658aa01af64a09b9912f454560c410 [file] [log] [blame]
from django.db.models.signals import post_save
from django.dispatch import receiver
import pdb
from core.models import *
import model_policies
@receiver(post_save)
def post_save_handler(sender, **kwargs):
sender_name = sender.__name__
policy_name = 'model_policy_%s'%sender_name
try:
policy_handler = getattr(model_policies, policy_name)
policy_handler.handle(sender)
except:
pass