mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-03-16 22:20:26 +00:00
* Audit changes to FK fields when saved using *_id naming.
In Django you can save changes to a FK field on a model using the ID
field name (attname) in addition to the regular FK field name with:
model.related_model_id = 42
model.save(update_fields=["related_model_id'])
or:
model.related_model = related_model
model.save(update_fields=["related_model_id'])
as opposed to the more common:
model.related_model = related_model
model.save(update_fields=["related_model'])
This change ensures those model changes are logged properly.
* Apply suggested change from code review.
* Add a CHANGELOG entry for the fix.
|
||
|---|---|---|
| .. | ||
| fixtures | ||
| templates | ||
| __init__.py | ||
| admin.py | ||
| apps.py | ||
| manage.py | ||
| models.py | ||
| test_commands.py | ||
| test_settings.py | ||
| tests.py | ||
| urls.py | ||
| views.py | ||