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