@receiver(post_delete, sender=UserPreference)
def post_delete_callback(sender, **kwargs):
 user_preference = kwargs['instance']
 emit_setting_changed_event(user_preference.user, sender._meta.db_table, user_preference.key, user_preference.value, None)

@ receiver ( post_delete , sender = UserPreference ) def post_delete_callback ( sender , ** kwargs ) : user_preference = kwargs [ 'instance' ] emit_setting_changed_event ( user_preference . user , sender . _meta . db_table , user_preference . key , user_preference . value , None )
event changes to user preferences .