django-auditlog icon indicating copy to clipboard operation
django-auditlog copied to clipboard

Adding Foriegn Key Only Fields

Open ndwhelan opened this issue 5 years ago • 2 comments

When building the changes JSON for a LogEntry, following relations (e.g. ForeigKey fields) can resutl in a significant performance penalty. This commit adds support for only logging to foreign key value, by specifying fields to log in this manner wiht a fk_only_fields when registering a model with the audit log.

ndwhelan avatar Oct 17 '20 04:10 ndwhelan

Codecov Report

Merging #280 into master will increase coverage by 0.28%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #280      +/-   ##
==========================================
+ Coverage   82.20%   82.49%   +0.28%     
==========================================
  Files          18       18              
  Lines         489      497       +8     
==========================================
+ Hits          402      410       +8     
  Misses         87       87              
Impacted Files Coverage Δ
auditlog/diff.py 88.23% <100.00%> (+1.13%) :arrow_up:
auditlog/registry.py 91.37% <100.00%> (+0.30%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 31418d5...8975d57. Read the comment docs.

codecov[bot] avatar Oct 17 '20 04:10 codecov[bot]

Thank you @ndwhelan for your PR. Can you please rebase it?

aqeelat avatar Dec 17 '22 20:12 aqeelat