Alpha release of django-model-revisioning

As the title states I’ve just released https://pypi.org/project/django-model-revisioning/

The intention of the application is similar to that of django-reversion, although it differs by being compatible with django migrations (django-reversion is not since it serializes data).

django-model-reversioning uses an metaclass (inheriting from django.db.models.base.ModelBase) to create a revisioned model of the model you want to revision. This means that the django migration framework treats the revisioned model the same way and thus creates migrations for it as well!

I’ve dug a lot around in the internal workings of models in django, although I’m unsure if I’m doing stuff all wrong.

So if you have any feedback to the approach, it is highly appreciated :slight_smile:

1 Like

My initial thoughts are that I love the sound of this! I don’t have an opportunity to have a play with it right now, but my initial thought is that if I’m understanding you correctly, it means that I’d be able to write migrations that update all my versioned data, and so wouldn’t have to add code to handle versions that were created prior to a migration; that’s something that should really be emphasised in the README to “sell” the library.

I’ll definitely be bookmarking it for an occasion when I need to store history!