* add new setting to activate string repr
* skip using foreign key to construct and display diff of foreign key fields
* concise name and documentation update
# Conflicts:
# docs/source/usage.rst
* add test for enabled setting
* fix code block in docs
* fix version
* add warning to documentation
* Add CustomLogEntry model support and update tests:
- Added support for CustomLogEntry data model to extend django-auditlog capabilities
- Updated existing test cases to align with new model structure and data handling logic
- Added new test cases to validate CustomLogEntry behavior, model registration, and signal handling
- Ensured backward compatibility with existing LogEntry model where applicable
* Update auditlog/__init__.py
Co-authored-by: Youngkwang Yang <me@youngkwang.dev>
* run only one custom model test matrix (#761)
---------
Co-authored-by: Youngkwang Yang <me@youngkwang.dev>
* Add `AUDITLOG_USE_BASE_MANAGER` setting configuration
* Adjust `LogEntry._get_changes_display_for_fk_field` behaviour for setting
* Adjust `log_update` and `log_m2m_changes` in `receivers.py` for setting
* Add `ModelManagerTest.test_use_base_manager_setting`
* Add entry in Usage documentation
* (In passing, fix a formatting issue in `usage.rst`)
The `AUDITLOG_USE_BASE_MANAGER` setting has a default of `False` to maintain
initial backwards compatibility with previous versions.
* Drop Python 3.9 support, set minimum version to 3.10
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update CHANGELOG.md
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix lint error
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add test runner and improve test with multi databases
* Enhance cross-database compatibility and testing
- Fix TRUNCATE command support detection for different databases
- Add conditional PostgreSQL-specific model registration
- Improve database-specific test skipping logic
- Remove SQLite from TRUNCATE supported vendors list
* Add docker compose for testing
* Improve CI/CD with multi-database support
- Add separate test workflows for SQLite, PostgreSQL, and MySQL
* Add `mysqlclient` deps
* fix minor
- Add mysqlclient deps
- upload coverage step
* Fix coverage upload name conflicts in CI workflow
- Add database type to coverage upload names (SQLite/PostgreSQL/MySQL)
* split auditlog HTML render logic from Admin mixin into reusable functions
* add AuditlogHistoryAdminMixin class
* add test cases for auditlog html render functions
* add audit log history view documentation
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Fix minor
* Add missing versionadded and configuration options for AuditlogHistoryAdminMixin
* Add missing test cases
* Update versionadded to 3.2.2 for AuditlogHistoryAdminMixin
* Update CHANGELOG.md
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Add support for Django 5.2
* Update setup.py
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
* docs: mention Django 5.2 in requirements and changelog
* docs: only keep Django 5.2 support line in changelog improvements
* docs: move and update Django 5.2 changelog entry with PR reference
* Update CHANGELOG.md
---------
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
* Add test cases for the `mask_str` function
* Add custom masking function support through mask_callable
* Add test cases for custom masking function
* Update documentation for custom masking function
* fix test case
* rename `AUDITLOG_DEFAULT_MASK_CALLABLE` variable
-AUDITLOG_DEFAULT_MASK_CALLABLE to `AUDITLOG_MASK_CALLABLE`
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update `CHANGELOG.md` to include mask function customization feature
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Branch that implements issue #675, basically, storing the correct JSON type that corresponds to the Python type (None -> null, 1 -> 1', not "1"`).
It's driven by a setting, AUDITLOG_ STORE_JSON_CHANGES , as recommended by @hramezani
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* code formatting tweaks from @hramezani
* increasing test coverage
* added usage for AUDITLOG_STORE_JSON_CHANGES setting
* updated CHANGELOG with info on AUDITLOG_STORE_JSON_CHANGES field
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* added another test for wrong setting type
* should not have committed temporary test changes
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Refactor: re-arrange test application
This was triggered by the need to run "python manage.py", which is impossible when serving the whole project in the same directory as is configured in INSTALLED_APPS ("auditlog_tests"). This setup is heavily inspired by other jazzband projects.
* Add check for missing migrations
* Add ability to globally mask fields by name on all models.
Fixes https://github.com/jazzband/django-auditlog/issues/701
* Add feature explanation in `usage.rst` file.
* Add a record to CHANGELOG.md file.
* Add test coverage.
* Add AUDITLOG_TRUNCATE_CHANGES_DISPLAY and AUDITLOG_TRUNCATE_LIMIT
To configure how many characters will be truncated or disable it
* Add AUDITLOG_CHANGE_DISPLAY_TRUNCATE_LENGTH settings
to keep or truncate strings of `changes_display_dict` property at a variable length
* Disable logging remote IP address
* Update auditlog/middleware.py
* Update CHANGELOG.md
* Update auditlog/middleware.py
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update auditlog/middleware.py and add tests in ManyRelatedModelTest
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
The code example for AUDITLOG_INCLUDE_TRACKING_MODELS made two distinct references to "model1" which seems to be a typo, should read "model2" on the second reference
* Disable on raw save prototype
* Contextmanager to disable instead of just raw - so we can catch m2m relations too
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
The doc is build with python 3.8, which includes the `importlib` API to
get the package version. Its use is recommended by `setuptools-scm` for
the doc.