@receiver(pre_save, sender=UserPreference)
def pre_save_callback(sender, **kwargs):
 user_preference = kwargs['instance']
 user_preference._old_value = get_changed_fields_dict(user_preference, sender).get('value', None)

@ receiver ( pre_save , sender = UserPreference ) def pre_save_callback ( sender , ** kwargs ) : user_preference = kwargs [ 'instance' ] user_preference . _old_value = get_changed_fields_dict ( user_preference , sender ) . get ( 'value' , None )
event changes to user preferences .