Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve auto model registration #550

Merged

Conversation

aqeelat
Copy link
Member

@aqeelat aqeelat commented Jul 25, 2023

closes #315
closes #548

feat: collect all models including auto created ones and excluding non-managed ones
feat: automatically register m2m fields for models when opting to auto register models

@aqeelat aqeelat requested a review from hramezani July 25, 2023 07:38
@aqeelat aqeelat force-pushed the improve_auto_model_registration branch from efd8727 to 64e013f Compare July 25, 2023 07:42
@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Merging #550 (71fce7a) into master (3dc4f1a) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #550      +/-   ##
==========================================
+ Coverage   94.54%   94.56%   +0.02%     
==========================================
  Files          30       30              
  Lines         898      902       +4     
==========================================
+ Hits          849      853       +4     
  Misses         49       49              
Files Changed Coverage Δ
auditlog/registry.py 98.69% <100.00%> (+0.03%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

…n-managed ones

feat: automatically register m2m fields for models when opting to auto register models
@aqeelat aqeelat force-pushed the improve_auto_model_registration branch from 64e013f to 71fce7a Compare July 25, 2023 07:47
@@ -14,6 +14,7 @@
- feat: Added pre-log and post-log signals. ([#483](https://github.com/jazzband/django-auditlog/pull/483))
- feat: Make timestamp in LogEntry overwritable. ([#476](https://github.com/jazzband/django-auditlog/pull/476))
- feat: Support excluding field names globally when ```AUDITLOG_INCLUDE_ALL_MODELS``` is enabled. ([#498](https://github.com/jazzband/django-auditlog/pull/498))
- feat: Improved auto model registration to include auto-created models and exclude non-managed models, and automatically register m2m fields for models. ([#550](https://github.com/jazzband/django-auditlog/pull/550))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't it be in Breaking Changes section?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this a breaking change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I was wrong

@hramezani
Copy link
Member

@aqeelat Thanks for this PR.

Only a question otherwise, LGTM

@hramezani hramezani merged commit f2591e4 into jazzband:master Aug 9, 2023
@aqeelat aqeelat deleted the improve_auto_model_registration branch August 10, 2023 11:04
@alxvallejo
Copy link

feat: collect all models including auto created ones and excluding non-managed ones

Why are we excluding non-managed models? Just because a model isn't managed doesn't mean we don't want to track changes to instances of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants