[Fixed]-Getting model instance by variable model name and pk

1👍

You can use django-dirtyfields and pre_save signal:

@receiver(pre_save, sender=MyModel)
def pre_save_logic(sender, instance, **kwargs):
    if 'my_field' in instance.get_dirty_fields():
        do_some_logic()

Leave a comment