etianen / django-reversion

django-reversion is an extension to the Django web framework that provides version control for model instances.
https://django-reversion.readthedocs.io
BSD 3-Clause "New" or "Revised" License
3.04k stars 489 forks source link

Use object_id other than primary key #963

Open sourabhv opened 9 months ago

sourabhv commented 9 months ago

I am working on cleaning an old database where the revisions of data are kept in same table with different id PK but share the same uuid (not the PK). When moving old data into django reversion before deleting it from this table, it picks up id and does not map values based on uuid. Is there a way to tell reversion to use a column besides pk?

etianen commented 9 months ago

This isn't supported right now, but could be with an additional parameter passed to reversion.register(). I'd happily take a PR for it.