mirror of
https://github.com/jazzband/django-auditlog.git
synced 2026-05-08 15:44:44 +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.
|
||
|---|---|---|
| .. | ||
| management | ||
| migrations | ||
| __init__.py | ||
| admin.py | ||
| apps.py | ||
| cid.py | ||
| conf.py | ||
| context.py | ||
| diff.py | ||
| filters.py | ||
| middleware.py | ||
| mixins.py | ||
| models.py | ||
| receivers.py | ||
| registry.py | ||
| signals.py | ||