Simple per-model log models for Django apps.
- Django 2.2+, 3.0+
- Python 3.6+
from django.db import models
from analog import define_log_model
class MyModel(models.Model):
value = models.IntegerField(default=0)
MyModelLogEntry = define_log_model(MyModel)
m = MyModel.objects.create(value=42)
m.add_log_entry('Something occurred')
assert m.log_entries.last().message == 'Something occurred'
pip install -e . pip install -r requirements-dev.txt
py.test
sphinx-build -b html docs docs/_build