* Add failing test for diffing polymorphic model instances. * Make diffing more robust for polymorphic models: When working with polymorphic models, where a child model inherits from a parent model, Django's pre_save signal may send model instances in a way where the log_update() handler receives an instance of the child as the `old` model, but an instance of the parent as the `new` model. This leads to a `FieldDoesNotExist` error when a field that only exists on the child was modified, and `get_field_value()` attempts look up that field on the parent. This change makes diffing polymorphic models more robust by considering this case in `get_default_value()`. Changes to those child fields won't be tracked in these cases, but at least `django-auditlog` won't prevent the model from being saved. |
||
|---|---|---|
| .github | ||
| auditlog | ||
| auditlog_tests | ||
| docs | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| .readthedocs.yaml | ||
| CHANGELOG.md | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| Makefile | ||
| MANIFEST.in | ||
| pyproject.toml | ||
| README.md | ||
| runtests.sh | ||
| setup.py | ||
| tox.ini | ||
django-auditlog
Migrate to V3
Check the Upgrading to version 3 doc before upgrading to V3.
django-auditlog (Auditlog) is a reusable app for Django that makes logging object changes a breeze. Auditlog tries to use as much as Python and Django's built in functionality to keep the list of dependencies as short as possible. Also, Auditlog aims to be fast and simple to use.
Auditlog is created out of the need for a simple Django app that logs changes to models along with the user who made the changes (later referred to as actor). Existing solutions seemed to offer a type of version control, which was found excessive and expensive in terms of database storage and performance.
The core idea of Auditlog is similar to the log from Django's admin. Unlike the log from Django's admin (django.contrib.admin) Auditlog is much more flexible. Also, Auditlog saves a summary of the changes in JSON format, so changes can be tracked easily.
Documentation
The documentation for django-auditlog can be found on https://django-auditlog.readthedocs.org. The source files are available in the docs folder.
License
Auditlog is licensed under the MIT license (see the LICENSE file for details).
Contribute
If you have great ideas for Auditlog, or if you like to improve something, feel free to fork this repository and/or create a pull request. I'm open for suggestions. If you like to discuss something with me (about Auditlog), please open an issue.
Releases
- Make sure all tests on
masterare green - Create a new branch
vX.Y.Zfrom master for that specific release - Update the CHANGELOG release date
- Pull request
vX.Y.Z->master - As a project lead, once the PR is merged, create and push a tag
vX.Y.Z: this will trigger the release build and a notification will be sent from Jazzband of the availability of two packages (tgz and wheel) - Test the install
- Publish the release to PyPI