-
Notifications
You must be signed in to change notification settings - Fork 420
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add register model using Django settings (#368)
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
- Loading branch information
Showing
6 changed files
with
326 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from django.conf import settings | ||
|
||
# Register all models when set to True | ||
settings.AUDITLOG_INCLUDE_ALL_MODELS = getattr( | ||
settings, "AUDITLOG_INCLUDE_ALL_MODELS", False | ||
) | ||
|
||
# Exclude models in registration process | ||
# It will be considered when `AUDITLOG_INCLUDE_ALL_MODELS` is True | ||
settings.AUDITLOG_EXCLUDE_TRACKING_MODELS = getattr( | ||
settings, "AUDITLOG_EXCLUDE_TRACKING_MODELS", () | ||
) | ||
|
||
# Register models and define their logging behaviour | ||
settings.AUDITLOG_INCLUDE_TRACKING_MODELS = getattr( | ||
settings, "AUDITLOG_INCLUDE_TRACKING_MODELS", () | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters