blob: 38caf01bcbc26ccac40b350f1aa54b037bb3fea7 [file] [log] [blame]
Sapan Bhatia0235e982014-09-03 13:14:40 -04001from django.db.models.signals import post_save
2from django.dispatch import receiver
3import pdb
4from model_policies import *
5
6@receiver(post_save)
7def post_save_handler(sender, **kwargs):
8 sender_name = sender.__name__
9 policy_name = 'model_policy_%s'%sender_name
10 try:
11 policy_handler = globals[policy_name]
12 policy_handler(sender)
13 except:
14 pass