django-simple-history icon indicating copy to clipboard operation
django-simple-history copied to clipboard

Diff between current and historical

Open december1981 opened this issue 6 years ago • 3 comments

Since an ORM "update()" is not the same as an explicit loop and ".save()" over the affected instances (as you note in the docs), we sometimes get differences between between the actual instance and the last created historical instance.

So I was going to make a change and fire off a pull request to add a feature like

pukka_instance.history.diff_against(historical_instance)

(there's currently no way to diff an actual instance with a historical one)

What say thee (before I go ahead with this)?

december1981 avatar Oct 25 '19 15:10 december1981

Hey! We currently have diff_against() here. Was this not sufficient for your needs?

kseever avatar Nov 20 '19 20:11 kseever

The problem with this is that it works only between two historical instances. I wanted something that would allow a difference between the current, actual, instance of an object and one of the historical instances (actually, the latest historical instance.)

As mentioned, the actual instance can be different from the latest historical instance, esp. if someone or some process runs an update on an instance instead of saving via save().

december1981 avatar Nov 24 '19 15:11 december1981

been a minute, but anything on this?

cuzox avatar Jan 24 '25 17:01 cuzox