2012-04-19 64 views

回答

1

從數據庫中檢索現有條目,然後將其與您即將保存的條目進行比較是實現此目的的一種非常簡單的方法。

existing_entry = Model.objects.get(pk=entry_to_save.pk) 
if existing_entry.image != entry_to_save.image: 
    # Your image has been modified 
entry_to_save.save()