AFAIK Django does not provide a generic way to see if data was changed by update_or_create()
The boolean created tells me that a row was created. But how can I know if data was changed (SQL UPDATE which changed data)
Example:
obj, created = MyModel.update_or_create(pk=12345,
defaults=dict(name='Doctor Zhivago'))
There are three cases:
objwas created. No problem, I have the boolean variablecreatedobjwas not created, it was updated. For example the previous name was "Machuca".objwas not created and not updated. For example the previous name was already "Doctor Zhivago".
I can't distinguish between case2 and case3 at the moment.