Getting Started
Installation
Install the package using pip:
Configuration
Add django_model_snapshots to your INSTALLED_APPS in settings.py:
Quick Start
Inherit from VersionableMixin in your model. That's it!
models.py
from django.db import models
from django_model_snapshots import VersionableMixin
class Product(VersionableMixin, models.Model):
name = models.CharField(max_length=100)
price = models.DecimalField(max_digits=10, decimal_places=2)
Now, every time you save() or delete() a Product, a historical record is created automatically.